# AD of UDEs - how to set it up?

**URL:** <https://discourse.julialang.org/t/ad-of-udes-how-to-set-it-up/133461>\
**Category:** Modelling & Simulations\
**Tags:** diffeq, sciml, autodiff\
**Created:** [October 27, 2025, 3:28pm UTC](https://discourse.julialang.org/t/ad-of-udes-how-to-set-it-up/133461 "2025-10-27T15:28:56Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [October 31, 2025, 7:13am UTC](https://discourse.julialang.org/t/ad-of-udes-how-to-set-it-up/133461/14 "2025-10-31T07:13:44Z")

</div>

> [@Emil\_Martinsen](#):
>
> Wouldnt it be more accurate to compare the non-filtered full-horizon model predictions with the data?

If the intention is to use the model for prediction, for instance for MPC, then certainly yes. There’s an ongoing discussion in this thread regarding different approaches to optimizing multi-step prediction performance rather than single-step performance.

> [@Robust resampling/interpolation method](https://discourse.julialang.org/t/robust-resampling-interpolation-method/132665/8):
>
> It’s not so much a convention as an explicit model that says it’s constant. If you use the model \dot{x}\_d = 0 + w for your low-frequency disturbance, i.e., an integrator of noise, you are explicitly modeling something that has zero deterministic dynamics (constant), only random fluctuations that are equally likely to go in any direction. There are more elaborate disturbance models that do not have zero dynamics, and in that case, simulating those forward in time (for forecasting) does not in…

In that tutorial in particular, we are interested in learning an unknown function, and since we have access to the ground truth of the unknown function the main comparison made is against this.

The summary of that discussion is that you typically want to perform filtering, and at each point in time start a multi-step prediction from the current filter estimate. Unless the prediction horizon you care about is super long (such that the information gained from using measurements up until the current time point does not matter for most of the prediction), using a multi-step prediction rather than pure simulation tend to be favorable.

---

_[View the full topic](https://discourse.julialang.org/t/ad-of-udes-how-to-set-it-up/133461)._
