Skip to content

docs: fix continuous tutorial forecasts - #506

Merged
MartinuzziFrancesco merged 1 commit into
SciML:masterfrom
Saswatsusmoy:docs/continuous-tutorial-defaults
Aug 19, 2026
Merged

docs: fix continuous tutorial forecasts#506
MartinuzziFrancesco merged 1 commit into
SciML:masterfrom
Saswatsusmoy:docs/continuous-tutorial-defaults

Conversation

@Saswatsusmoy

Copy link
Copy Markdown
Contributor

Summary

The continuous Lorenz / Mackey-Glass examples rebuilt a second model and only copied the readout, so AR started cold and the plots collapsed.

Reuse the trained ps/st after #499, match the discrete Lorenz HPs (N=300, radius=0.9, RidgeRegression(1e-6)), and plot coordinates vs Lyapunov time like lorenz_basic.md.

Checklist

  • Tutorial examples were run locally
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC
  • Any new documentation only uses public API

The examples rebuilt a second model and only copied the readout,
so AR started cold and the Lorenz plots collapsed.

Reuse the trained ps/st, match the discrete Lorenz HPs, and plot
coordinates vs Lyapunov time.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0eea1f5249

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

lorenz_maxlyap = 0.9056
lyap_time = (0:(predict_len - 1)) .* dt .* (1 / lorenz_maxlyap)

p1 = plot(lyap_time, [test[1, :] output[1, :]]; label = ["actual" "predicted"],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Align actual series with one-step forecasts

When warm-starting from the st returned by train, test[:, 1] is the seed value already used as initialdata, and predict stores the output only after advancing one autoregressive step. This means output[:, 1] forecasts the sample after test[:, 1], but the plot compares it against test[:, 1] itself, shifting the actual curve by one step; the same pattern appears in the SciML reservoir Lorenz and Mackey-Glass plots. Use an actual slice that starts at the next sample, or compare against test[:, 2:end] with matching prediction length.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same overlay as lorenz_basic / getting started / the readme. predict always writes the first forecast after the seed, so those plots are also one sample off at dt=0.02. not visible on the lyapunov-time axes and not what made the old continuous plots collapse. leaving it so this page stays in lockstep with the discrete example.

@MartinuzziFrancesco
MartinuzziFrancesco merged commit 0e0b64e into SciML:master Aug 19, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants