DOC: Document how to call `DifferentialEquation` in a model (`y0`, `theta`, output shape)

Open Beginner friendly
#8,616 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

@saheli56 is already working on this.

Since Nov 11, 2026.

  • #8624 by @saheli56 — open

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
documentation

Research direction

The issue names the DifferentialEquation docstring in pymc/ode/ode.py; start by reading that docstring and the existing example. Add the proposed explanations for y0, theta, and output shape. Done means the docstring explains the call arguments and both output shapes.

Written by the indexing model from the issue text.

Description

docs

Page: pymc.ode.DifferentialEquation

Problem

The docs describe the DifferentialEquation constructor, but not how to call the object it returns inside a PyMC model. That call takes two arguments, y0 (the initial state) and theta (the parameters), and neither is explained. The example on the page stops at constructing ode_model.

The docs also don't say what shape the output has. The docs for scipy.integrate.odeint, the function this class calls internally, state the output shape in their Returns section, and something similar here would help.

Proposed addition

After the parameter list, or as an extension of the existing example:

Calling the object returned by DifferentialEquation takes two arguments:

  • y0: the initial state, one value per state variable.
  • theta: the parameter vector, in the order func expects.

The output has shape (number of time points, number of states): one row per entry in times and one column per state. When sampled values are stored, the chain and draw axes come first, so a stored result has shape (chain, draw, time points, states).

I haven't included a reproducible example since this is a documentation proposal, not a bug, but I can supply one if it's useful. The change would be to the DifferentialEquation docstring in pymc/ode/ode.py, and I'm happy to open a PR if it's wanted.

Dominant language
Python
Stars
9.9k
Forks
2.4k
Avg merge
4d 10h
Merged PRs (30d)
12

Getting set up

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.

More from pymc-devs/pymc

All issues in pymc-devs/pymc

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.