# UDE pre-fitting with collocation

**URL:** <https://discourse.julialang.org/t/ude-pre-fitting-with-collocation/117326>\
**Category:** Modelling & Simulations\
**Tags:** question, sciml\
**Created:** [July 22, 2024, 7:58am UTC](https://discourse.julialang.org/t/ude-pre-fitting-with-collocation/117326 "2024-07-22T07:58:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![martincornejo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/martincornejo/32/13436_2.png) [@martincornejo](https://discourse.julialang.org/u/martincornejo)\
**Post date:** [July 22, 2024, 7:58am UTC](https://discourse.julialang.org/t/ude-pre-fitting-with-collocation/117326/1 "2024-07-22T07:58:08Z")

</div>

Hi, I’d like to pre-train a UDE model using the collocation method from `DiffEqFlux.jl`: [Smoothed Collocation · DiffEqFlux.jl](https://docs.sciml.ai/DiffEqFlux/stable/utilities/Collocation/)

My dataset is 10 days worth of temperature measurements and has around 45,000 points which are non-uniformly time distributed (the median time step is around 20 seconds).

Usind the standard `TriangularKernel` the estimated derivatives look as following (yellow: real data, blue: `u` and `u´` collocation output):  
 ![grafik](https://global.discourse-cdn.com/julialang/original/3X/9/d/9daf83c163339e44b0756778d461d70a27d4b20b.png)

from which is clear that the data (and derivative) have been excessively smoothed. I also tried other kernels without better results (`EpanechnikovKernel`, `GaussianKernel`, `UniformKernel`).

Should I use a specific kernel? Is there an optional argument in `collocate_data` to control the smoothness I’m missing?

Is such a smoothet out dataset enough to pre-train the UDE?
