Stan simulation running extremely slow

38 views
Skip to first unread message

Michael Benezra

unread,
Nov 2, 2016, 9:05:50 AM11/2/16
to Stan users mailing list
After adding the following line to my Stan model, the simulation runs extremely slow:

to_vector(beta_v) ~ normal(to_vector(beta_t), sigma_beta_v);

where the parameters are declared as follows:

matrix[K,J] beta_t;
matrix[K,J] beta_v;
real<lower=0> sigma_beta_t;

Am I using very inefficient code? If so how can I improve on it. If it helps I can paste the entire Stan code. Much thanks for your help :)

Ben Goodrich

unread,
Nov 2, 2016, 10:07:14 AM11/2/16
to Stan users mailing list
On Wednesday, November 2, 2016 at 9:05:50 AM UTC-4, Michael Benezra wrote:
Am I using very inefficient code? If so how can I improve on it. If it helps I can paste the entire Stan code. Much thanks for your help :)

That one line will execute relatively quickly. The rest of the code likely needs reparameterizations.

 

Daniel Lee

unread,
Nov 2, 2016, 2:58:37 PM11/2/16
to stan-users mailing list
Hi Michael,

Ben is answering your direct question: "Am I using very inefficient code?" The answer is no. The code is fine and it's fast.

What you're really trying to get at is why is inference slow. And the answer is because it "likely needs reparameterizations" or you'll need to think about your model.



Daniel


--
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+unsubscribe@googlegroups.com.
To post to this group, send email to stan-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bob Carpenter

unread,
Nov 2, 2016, 3:06:17 PM11/2/16
to stan-...@googlegroups.com
It helps if you send the whole program.

- Bob
> --
> 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.
Reply all
Reply to author
Forward
0 new messages