docs
docs copied to clipboard
Error in "32.2 Example decision analysis"
Summary:
@Ullrika pointed out that "32.2 Example decision analysis" https://mc-stan.org/docs/2_29/stan-users-guide/example-decision-analysis.html has an error in the code.
The utility function is defined with arguments c and t
real U(real c, real t) {
return -(c + 25 * t);
}
The model block has
t ~ lognormal(mu[d], sigma[d]);
c ~ lognormal(nu[d], tau[d]);
and the generated quantities block has
util[k] = U(lognormal_rng(mu[k], sigma[k]),
lognormal_rng(nu[k], tau[k]));
Here mu and ´sigmaare parameters corresponding totand it is provided as the first argument which should bec`.
As the arguments in the generated quantities are in the wrong order, the generated quantities are wrong.
Current Version:
v2.29.0