The noisemodel
keyword argument in ps.Model and noise
keyword argument in ml.solve are Deprecated as of Pastas 1.5
#735
Labels
Milestone
This thread is used to explain users the change of deprecating the
noisemodel
inps.Model
andnoise
argument inml.solve
andml.initialize
methods. The error messages are linked to this issue, which is pinned at the top of the issue page.Changes to default behavior regarding noise models in pastas>=1.5
Noise models are no longer added to time series models by default. From Pastas 1.5
onwards we are forcing users to explicitly add a noise model to their time series model
should they want to use one.
Warning
This means that if you are running old code with the new version of
Pastas and haven't specified anything with respect to the noise model in your code
(thereby relying on Pastas defaults) the result will change !
Contents
Remind me, what is a noise model?
A noise model can be used to try to reduce the residuals (simulation minus
observations) to white noise. When the noise (the result after applying the noise model
to the residuals) meets the criteria of white noise, this means we can make certain
statistical inferences with our time series model. For example, when the noise meets
these criteria, the estimated parameter uncertainty is reliable and can be used to
quantify model uncertainty. For more information about the noise model, check out the
following notebooks:
Why are we changing the default in Pastas?
There are several reasons:
do not require a noise model (e.g. Monte Carlo Markov Chain available with the Emcee solver).
of the noise model right away. Instead the complexity of the time series models can
be increased progressively as users gain more insight into time series modeling.
Overview of changes
Starting from pastas 1.5:
noisemodel
keyword argument inps.Model()
is removed.noise
keyword argument inml.solve()
is removed.report (
ml.fit_report()
) and the model results plot (ml.plots.results()
). Thesecan be shown by passing
stderr=True
to either function.ps.ArNoiseModel
(wasps.NoiseModel
) andps.ArmaNoiseModel
(wasps.ArmaModel
).Guide for updating to Pastas 1.5
The following section explains how to update your code for pastas>=1.5.
Where applicable, the equivalent code for pastas<=1.4 and pastas>=1.5 is shown.
Adding a noise model
In pastas<=1.4 a noise model was added automatically, unless users opted-out.
In pastas>=1.5 a noise model has to be added explicitly:
Reproducing old default behavior (modeling with a noise model)
In pastas<=1.4, this was the default:
To reproduce this result in pastas>=1.5:
Solving a model without and then with a noise model (two-step solve)
In pastas<=1.4 this could be done as follows:
In pastas>=1.5, this now becomes:
Solving without a noise model
If a model already has a noise model (for example, when loading old stored models).
Pastas<=1.4:
Pastas>=1.5
Displaying the estimated parameter uncertainty
In pastas<=1.4 the estimated parameter uncertainty was always shown in the model fit
report and model results plot. This was not always appropriate as these errors are only
reliable if the residuals meet certain criteria. The user now has to explicitly define
whether to show these estimates.
To show the parameter uncertainty estimates in the fit report in pastas>=1.5:
To show the parameter uncertainty estimates in the results plot in pastas>=1.5:
To show the parameter uncertainty estimates after
ml.solve()
:The text was updated successfully, but these errors were encountered: