docs: fix continuous tutorial forecasts - #506
Conversation
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.
There was a problem hiding this comment.
💡 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"], |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
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/stafter #499, match the discrete Lorenz HPs (N=300,radius=0.9,RidgeRegression(1e-6)), and plot coordinates vs Lyapunov time likelorenz_basic.md.Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC