Initial Value Rejection with CVODE

38 views
Skip to first unread message

Arya Pourzanjani

unread,
Apr 4, 2016, 6:39:03 PM4/4/16
to Stan users mailing list

I'm trying to fit parameters to a 4 state ODE and I get the error below. The Stan and data files are attached. I'd like to learn the control flow of a Stan program so I can figure out things like this on my own. What's the best way to compile Stan to run with GDB, or am I stuck putting print statements in Stan source code and recompiling every time?


Arya$ coag/rar diagnose data file=coag/rar.data.R 

method = diagnose

  diagnose

    test = gradient (Default)

      gradient

        epsilon = 9.9999999999999995e-07 (Default)

        error = 9.9999999999999995e-07 (Default)

id = 0 (Default)

data

  file = coag/rar.data.R

init = 2 (Default)

random

  seed = 3933974504

output

  file = output.csv (Default)

  diagnostic_file =  (Default)

  refresh = 100 (Default)



Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:

Exception thrown at line 84: CVode failed with error flag -1

If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,

but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.

rar.stan
rar.data.R

Michael Betancourt

unread,
Apr 5, 2016, 9:47:21 AM4/5/16
to stan-...@googlegroups.com
Stan is like any other C++ program and can be run through GDB with enough
effort, although you’ll have to be careful because of all the templates.  Print
statements are typically much faster than trying to following GDB as it bounces
between Stan and CVODE.

The -1 error states that CVODE hit the max_num_steps threshold that you
specified (See Section B.2 of the CVODE manual), which is not uncommon
out in the tails of the parameters. You can increase the threshold from 1e6 to
1e8 or the like or find a better initial condition, but your model looks sufficiently 
complex that I would step back and start with something simpler.  The bounds
are not helping anything — use soft contains with priors instead.  The 1e-11
in the ODE specification is a sure sign that you can rescale your parameters
so that they’re all O(1) which could make huge improvements. 

--
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.
<rar.stan><rar.data.R>

Reply all
Reply to author
Forward
0 new messages