stan-dev / stan-dev/docs

Improve ODE max_num_steps parameter documentation

Open
#283 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TeX
Stars
43
Forks
133
Avg merge
11h 32m
Merged PRs (30d)
4

Description

Summary:

The max_num_steps parameter for ODE solvers and how to set it could be explained more exactly.

Description:

Documentation (Section 13.6) says "… and max_num_steps specifies the maximum number of steps the solver will take between output time points before throwing an error" and “The maximum number of steps can be used to stop a runaway simulation.”

  • I think it’s misleading to talk about throwing an error or stopping a simulation, since this doesn't stop a chain, instead it prints the message
Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
Chain 4 Exception: Exception: integrate_ode_rk45:  Failed to integrate to next output time (1) in less than max_num_steps steps

at least during warmup. If max_num_steps is reached during sampling, then it seems to be marked as a divergence, and sometimes if I set max_num_steps to a ridiculously low value, I can get
Warning: Chain 4 finished unexpectedly!.

  • In general, this is confusing and I would really like know what actually happens if max_num_steps is reached, and does it depend on whether the chain is doing warmup or sampling. Or in what case does it just reject and try a new proposal, and when does it actually stop a chain and when mark it as divergence.

  • In some earlier version of Stan, an error was actually thrown if max_num_steps was reached when trying to compute log probability for the initial parameter values, but I think @bbbales2 told me that it has now changed and instead a new initial point is drawn?

Additional Information:

See my Discourse post .

Current Version:

v2.25

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with documentation Section 13.6 and the linked Discourse post, focusing on the described max_num_steps behavior in Stan v2.25. Trace how reaching the limit differs during warmup, sampling, and initial parameter evaluation, then update the documentation so each outcome is stated accurately and verify the revised explanation against the reported messages.

Written by the indexing model from the issue text.

Assessment

Tech stack
tex
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.