pastas.model.Model.solve#

Model.solve(tmin=None, tmax=None, freq=None, warmup=None, noise=True, solver=None, report=True, initial=True, weights=None, fit_constant=True, **kwargs)[source]#

Method to solve the time series model.

Parameters:
  • tmin (str, optional) – String with a start date for the simulation period (E.g. ‘1980’). If none is provided, the tmin from the oseries is used.

  • tmax (str, optional) – String with an end date for the simulation period (E.g. ‘2010’). If none is provided, the tmax from the oseries is used.

  • 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”.

  • warmup (float, optional) – Warmup period (in Days) for which the simulation is calculated, but not used for the calibration period.

  • noise (bool, optional) – Argument that determines if a noisemodel is used (only if present). The default is noise=True.

  • solver (Class pastas.solver.Solver, optional) – Instance of a pastas Solver class used to solve the model. Options are: ps.LeastSquares() (default) or ps.LmfitSolve(). An instance is needed as of Pastas 0.23, not a class!

  • report (bool, optional) – Print a report to the screen after optimization finished. This can also be manually triggered after optimization by calling print(ml.fit_report( )) on the Pastas model instance.

  • initial (bool, optional) – Reset initial parameters from the individual stress models. Default is True. If False, the optimal values from an earlier optimization are used.

  • weights (pandas.Series, optional) – Pandas Series with values by which the residuals are multiplied, index-based. Must have the same indices as the oseries.

  • fit_constant (bool, optional) – Argument that determines if the constant is fitted as a parameter. If it is set to False, the constant is set equal to the mean of the residuals.

  • **kwargs (dict, optional) – All keyword arguments will be passed onto minimization method from the solver. It depends on the solver used which arguments can be used.

Return type:

None

Notes

  • The solver instance including some results are stored as ml.fit. From here one can access the covariance (ml.fit.pcov) and correlation matrix ( ml.fit.pcor).

  • Each solver returns a number of results after optimization. These solver specific results are stored in ml.fit.result and can be accessed from there.

See also

pastas.solver

Different solver objects are available to estimate parameters.