I want to do predictions via generated quantities block in stan. I have two questions:
- Should the weights be applied again in the generated quantities block in addition to the likelihood in the model block? (a) or (b)?
- What values of the variable
weights
should I use in the predictions (i.e., in generated quantities block)?
(a)
model{
...
target += weights[i] * binomial_lpmf(...);
...
}
generated quantities{
...
y_pred[i] = weights[i] * inv_logit(...);
...
}
(b)
model{
...
target += weights[i] * binomial_lpmf(...);
...
}
generated quantities{
...
y_pred[i] = inv_logit(...);
...
}