Giter Site home page Giter Site logo

Comments (5)

JeunghyunLee avatar JeunghyunLee commented on September 28, 2024

Could you explain which simulation score or simulated data you are referring to?

If you are asking about l, which is used to compute the utility of lth balloon pump, this value falls between the range of max pump for each balloon, noted as P. Still, please specify the simulation that you are asking about for a clearer answer!

from hbayesdm.

Airyyy avatar Airyyy commented on September 28, 2024

I am asking about the trial-level posterior predictive simulations y_pred.

for (l in 1:(pumps[j, k] + 1 - explosion[j, k])) {
          // u_gain always equals r ^ rho.
          u_loss = (l - 1);

          u_pump = (1 - p_burst) * u_gain - lambda[j] * p_burst * u_loss +
          rho[j] * p_burst * (1 - p_burst) * (u_gain + lambda[j] * u_loss)^2;
          // u_stop always equals 0.

          delta_u = u_pump - u_stop;

          log_lik[j] += bernoulli_logit_lpmf(d[j, k, l] | tau[j] * delta_u);
          y_pred[j, k, l] = bernoulli_logit_rng(tau[j] * delta_u);
}

In the above code block, y_pred[j, k, l] means the lth pump on trail k of the jth person. I am confused about why can't l be larger than pumps[j, k] + 1 - explosion[j, k]).
Secondly, if the simulated y_pred[j, k] is [1, 1, 1, 0, 1, ..., 1, nan, ...] for kth trail of the jth person, is it right to regard the number of pumping of trial k as 3?
Thirdly, if the kth trail of the 'j'th person exploded at the 5th pump, but the simulated y_pred[j, k] is [1, 1, 0, 1, 1, nan, ...], is it right to regard the simulated y_pred[j, k] not exploded?

from hbayesdm.

JeunghyunLee avatar JeunghyunLee commented on September 28, 2024
  1. It’s because l is updated per pump, until the last pump available. If you trace back to the top of the stan file, pumps[j,k] refers to the number of pumps made so far and explosion[j, k] is a binary value (0/1) of whether the balloon exploded.
  2. The posterior prediction y_pred refers to the probability of the subject pumping the balloon. If you are looking for the probability of the balloon explosion, that would be p_burst.

from hbayesdm.

Airyyy avatar Airyyy commented on September 28, 2024
  1. If the max number of pump in bart is 60, and for the kth balloon of jth person, the jth person stop pumping at the 30th pump, so pumps[j, k] is 30 and explosion[j, k] is 0, which means l <= 31. But why can't l be larger than 31 cause it may not exploded at 31th pump?
  2. In your code, y_pred is a binary value (0/1)

from hbayesdm.

JeunghyunLee avatar JeunghyunLee commented on September 28, 2024
  1. If the given pumps[j, k] is 30, that means the subject already pumped the balloon 30 times in that trial, which rules out the possibility of the 31th pump. Looking into the sample data should help?
  2. Yes, the posterior prediction y_pred should save the model’s prediction for each choice made by the participants (whether they choose to pump or not to pump at each moment). So it should be a binary value.

from hbayesdm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.