parameters {
...
real exp_subclinical[n_years];
...
}
model {
exp_subclinical[1] ~ uniform(1,upper_lambda1);
for( oy in 2:n_years ){
exp_subclinical[oy] ~ gamma(exp_subc_k, exp_subc_k/exp_subclinical[oy-1]);
}
...
}
Exception thrown at line 104: stan::math::gamma_log: Inverse scale parameter is -61.6392, but must be > 0!
Jonah
One issue is that parameters with constraints need to be declared with those constraints in the parameters block or you can get invalid proposals. So if a parameter has to be positive it should be declared with <lower=0>, if it's a probability it needs to be declared with <lower=0, upper=1>, etc. So using a constrained uniform distribution on a parameter declared without those constraints is a problem. Does that parameter actually have a logical lower bound of 1? If you just think it's unlikely for it to be less than 1 than I would use a prior that places low probability mass in (0,1) but without impose a lower bound of 1 unless it's a logical requirement.Jonah
I don't understand how the inverse scale parameter can become negative, being the division of a positive value by a value which is either from a uniform(1,some positive value I supplied) or a gamma distribution.
theta ~ gamma(a, b)
theta ~ gamma(a, b)
increment_log_prob(gamma_log(theta, a, b))
x <- gamma_rng(a,b)
This reminds me . . . have we considered removing the uniform distribution entirely from Stan? It seems like the _only_ use for it is either completely redundant or else wrong (e.g., a variable is defined as unconstrained but then the user gives a uniform with fixed bounds).
You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/AqBZT2h5Jyw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+...@googlegroups.com.
about the usefulness of the uniform:for me it was very useful when I had difficulties using the Cauchy distribution,which, as the stan reference explains can be difficult to sample from becausedifferent step sizes are optimal dependent on if one is in the tails or not.as recommended in the stan reference I then re-parameterizedchauchy(location, scale)tolocation + scale * tan(uniform(0,pi()/2))which worked much better.so please keep the uniform!!
On Feb 5, 2016, at 11:23 AM, Michael Betancourt <betan...@gmail.com> wrote:
To clarify, Jonah meant inverse-cdf-ing the CDF of a parameter whose prior is standard normal.
Ben
--
You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/AqBZT2h5Jyw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+...@googlegroups.com.