The real Stan folks can give you a more complete answer, but I noticed a few things that you can change that might help things out:1. You can get rid of all the uniform(0,10) sampling statements and just declare the parameters with lower=0 and upper=10 constraints. Not sure how much this will help performance, but it certainly won't hurt.2. You can use the "Matt trick" for all the normal priors on the coefficients. For example, for a0, you would doparameters {
a0_raw ;}transformed parameters {
a0 ;a0 <- a0_raw * a0_sigma ;}model {a0_raw ~ normal(0,1) ;}Making the sampling statements all for standard normals often helps quite a bit.
On Friday, January 30, 2015 at 5:45:14 AM UTC-5, David Westergaard wrote:
--
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/s1uqTRUN12c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Jan 30, 2015, at 11:37 AM, Jonah <jga...@gmail.com> wrote:
The real Stan folks can give you a more complete answer, but I noticed a few things that you can change that might help things out:1. You can get rid of all the uniform(0,10) sampling statements and just declare the parameters with lower=0 and upper=10 constraints. Not sure how much this will help performance, but it certainly won't hurt.2. You can use the "Matt trick" for all the normal priors on the coefficients. For example, for a0, you would doparameters {a0_raw ;}transformed parameters {a0 ;a0 <- a0_raw * a0_sigma ;}model {a0_raw ~ normal(0,1) ;}Making the sampling statements all for standard normals often helps quite a bit.
On Friday, January 30, 2015 at 5:45:14 AM UTC-5, David Westergaard wrote:
I am not quite sure i understand the problem. I am well aware that some of the intercepts will have minimal influence on the measurement value, and that is exactly the case. I have included some, plus their interactions, to show these have no effect. E.g. that the measurement value does not vary regardless of age and gender.
If this is not the “correct" way of doing it, then I am open for suggestions. Would it be better to have a group wide prior on each nominal variable?
Cheers,
David
a0 <- a0_raw * a0sigma + a0_raw_mean;aS <- aS_raw * aSsigma + aS_raw_mean;a1 <- a1_raw * a1sigma + a1_raw_mean;a2 <- a2_raw * a2sigma + a2_raw_mean;a3 <- a3_raw * a3sigma + a3_raw_mean;a4 <- a4_raw * a4sigma + a4_raw_mean;a1a2 <- a1a2_raw * a1a2sigma + a1a2_raw_mean;a1a4 <- a1a4_raw * a1a4sigma + a1a4_raw_mean;a2a4 <- a2a4_raw * a2a4sigma + a1a2_raw_mean;a1a2a4 <- a1a2a4_raw * a1a2a4sigma + a1a2a4_raw_mean;|to:|a0 <- a0_raw * a0sigma + a0_raw_mean;aS <- aS_raw * aSsigma;a1 <- a1_raw * a1sigma;a2 <- a2_raw * a2sigma;a3 <- a3_raw * a3sigma;a4 <- a4_raw * a4sigma;a1a2 <- a1a2_raw * a1a2sigma;a1a4 <- a1a4_raw * a1a4sigma;a2a4 <- a2a4_raw * a2a4sigma;a1a2a4 <- a1a2a4_raw * a1a2a4sigma;|while eliminating lines 127 through 135 and 81 through 89.Also, for clarity's sake, you should be putting your upper bounds on your sigma parameters in the parameter block, like so:|real<lower=0,upper=100> a0sigma;|