Hope, yes. Success, maybe. The sparse / dense distinction isn't that useful because Stan doesn't have sparse operations natively. But a few things will help:
- For unknowns, use the Matt trick. For example, make b be a transformed parameter that is equal to sqrt(sigma2b) * b_z and specify b_z ~ normal(0,1) in the model block. Also, if you want, you can parameterize the model in terms of standard deviations rather than variances to avoid taking the sqrt. Same thing for m I guess.
- For a, use the multivariate Matt trick: a <- sqrt(sigma2a*(1-w)) * (L * a_z) where L is the Cholesky factor of A (which I assume is fixed? If so, it need only be calculated once.) and to_vector(a_z) ~ normal(0,1).
--
You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I am only puzzled why the D case gave smaller ESS/s than the C case with low signal to noise ratio. Looks like increment_log_prob(-0.5 * dot_self(m_z)) seems to be more expensive than m_z ~ normal(0, 1).
Nope, seeds are fixed and the same and data were simulated with the same seed and no parallel option has been used.
> t(head(arrC[,1,1:10]))
iterations
parameters [,1] [,2] [,3] [,4] [,5] [,6]
sigmam 1.3401131 0.10643634 0.28039193 0.2972958 0.2568142 0.2095128
sigmae 3.3216160 0.94050485 0.93174248 0.8534418 0.9645617 1.1897986
m_z[1] -0.5761818 -0.49504610 0.38862007 -2.0152083 -1.3475779 1.2056722
m_z[2] 1.0158917 0.06284838 1.36142080 -0.5952259 0.3629760 -0.4368263
m_z[3] 0.2607877 -0.14910629 0.01535360 -1.1963885 0.8879193 -0.6953773
m_z[4] -0.5867950 0.16044735 -1.76803498 -1.4119256 -0.5433785 1.2876976
m_z[5] -1.1999572 -0.47409605 0.07889035 -0.9584701 -1.4787338 1.7870860
m_z[6] 1.4919094 -2.50773788 -0.36482323 0.3719719 -0.2567169 -0.8900840
m_z[7] 0.4050900 -0.10924341 1.46335665 -2.1849007 -0.3856866 -0.7818294
m_z[8] -1.4186088 0.95827890 0.84409804 0.1912828 1.4955910 -1.3362855
> t(head(arrD[,1,1:10]))
iterations
parameters [,1] [,2] [,3] [,4] [,5] [,6]
sigmam 1.3401131 0.10643634 0.28039194 0.2972571 0.68857399 0.51182635
sigmae 3.3216160 0.94050485 0.93174249 0.8536075 0.91815863 0.81093004
m_z[1] -0.5761818 -0.49504610 0.38862007 -2.0160854 0.80002624 0.50341024
m_z[2] 1.0158917 0.06284838 1.36142080 -0.5953613 -1.72048518 0.30587675
m_z[3] 0.2607877 -0.14910629 0.01535358 -1.1963325 -1.80457022 -0.35338513
m_z[4] -0.5867950 0.16044735 -1.76803498 -1.4117631 -1.01547968 0.42159052
m_z[5] -1.1999572 -0.47409605 0.07889036 -0.9583879 -1.20190410 0.68534284
m_z[6] 1.4919094 -2.50773788 -0.36482322 0.3718981 0.31037416 0.12127858
m_z[7] 0.4050900 -0.10924341 1.46335667 -2.1855385 -0.82166545 2.22916078
m_z[8] -1.4186088 0.95827890 0.84409806 0.1911291 0.05642842 0.05920981