Model#
- class Model(oseries, constant=True, noisemodel=True, name=None, metadata=None, freq='D')[source]#
Class that initiates a Pastas time series model.
- Parameters:
oseries (pandas.Series) – pandas.Series object containing the dependent time series. The observation can be non-equidistant.
constant (bool, optional) – Add a constant to the model (Default=True).
noisemodel (bool, optional) – Add the default noisemodel to the model. A custom noisemodel can be added later in the modelling process as well.
name (str, optional) – String with the name of the model, used in plotting and saving.
metadata (dict, optional) – Dictionary containing metadata of the oseries, passed on to the oseries when creating a pastas TimeSeries object. hence, ml.oseries.metadata will give you the metadata.
freq (str, optional) – String with the frequency the stressmodels are simulated. Must be one of the following: (D, h, m, s, ms, us, ns) or a multiple of that e.g. “7D”. Default is “D”. New in 0.18.0.
- Returns:
ml – Pastas Model instance, the base object in Pastas.
- Return type:
Examples
A minimal working example of the Model class is shown below:
>>> oseries = pd.Series([1,2,1], index=pd.to_datetime(range(3), unit="D")) >>> ml = Model(oseries)
Methods#
Add a Constant to the time series Model. |
|
Adds a noisemodel to the time series Model. |
|
Add a stressmodel to the main model. |
|
Add a Transform to the time series Model. |
|
Method to copy a model. |
|
Method to safely delete the Constant from the Model. |
|
Method to safely delete the noise model from the Model. |
|
Method to safely delete a stress model from the Model. |
|
Method to safely delete the transform from the Model. |
|
Method that reports on the fit after a model is optimized. |
|
Method to obtain the block response for a stressmodel. |
|
Method to get the contribution of a stressmodel. |
|
Method to get contributions of all stressmodels. |
|
Method to get all initial parameters from the individual objects. |
|
Method to get all the modeled output time series from the Model. |
|
Method to obtain the parameters needed for calculation. |
|
Method to get the tmax used for the response function. |
|
Method to obtain the step response for a stressmodel. |
|
Method to obtain the stress(es) from the stressmodel. |
|
Returns list of stressmodel names. |
|
Method to obtain the time series settings for a stress model. |
|
Method that checks and returns valid values for tmax. |
|
Method that checks and returns valid values for tmin. |
|
Method to get the contribution of a transform. |
|
Method to initialize the model. |
|
Method to simulate the noise when a noisemodel is present. |
|
Internal method to calculate the noise weights. |
|
Method that returns the observations series used for calibration. |
|
Method to calculate the residual series. |
|
Method to change the parameter properties. |
|
Method to simulate the time series model. |
|
Method to solve the time series model. |
|
Method to export a model to a dictionary. |
|
Method to save the Pastas model to a file. |