Is it possible to pause stan() to detect convergence using gelman.diag() ?

58 views
Skip to first unread message

Kavya C

unread,
Apr 15, 2017, 2:03:51 AM4/15/17
to Stan users mailing list
Goal: To automate the process of detection of (non) convergence so that I have better idea of number of Stan iterations/chains that I need to run.  

I'm using gelman.diag() to detect convergence. Is it possible to 
  • Run X number of iterations via Stan, 
  • Store all the result/variables, 
  • Run diagnostics and if there is no convergence yet, 
  • Reuse the result/variable to continue running all chains from where we previously left. 

Ben Goodrich

unread,
Apr 15, 2017, 9:49:48 AM4/15/17
to Stan users mailing list
Not currently
 

Stephen Martin

unread,
Apr 23, 2017, 3:44:00 PM4/23/17
to Stan users mailing list
I asked something similar here a while back. One /could/ write a function that calls stan for X iterations, tests convergence, if not at threshold, then call stan again and append the samples to the previous samples.

Ideally, one could literally pick up one where left off using the final posterior sample of the first X iterations as the inits for the second (and so on), but iirc the stan devs said they don't have a way of specifying or returning (can't recall which) the mass matrix and other warmup parameters so that one could skip warmup and jump straight to where you left off.

Daniel Lee

unread,
Apr 24, 2017, 12:08:55 AM4/24/17
to stan-...@googlegroups.com
None of the interfaces allow you to do it, but I'll confirm what Stephen has written. You can do this if you write the appropriate function in C++. You'd want to use what's in github.com/stan-dev/stan as a template. 


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