pastas.model.Model ================== .. toctree:: :hidden: /api/pastas/model/Model.add_stressmodel /api/pastas/model/Model.add_constant /api/pastas/model/Model.add_transform /api/pastas/model/Model.add_noisemodel /api/pastas/model/Model.del_stressmodel /api/pastas/model/Model.del_constant /api/pastas/model/Model.del_transform /api/pastas/model/Model.del_noisemodel /api/pastas/model/Model.simulate /api/pastas/model/Model.residuals /api/pastas/model/Model.noise /api/pastas/model/Model.observations /api/pastas/model/Model.add_solver /api/pastas/model/Model.solve /api/pastas/model/Model.reset_settings /api/pastas/model/Model.set_settings /api/pastas/model/Model.set_parameter /api/pastas/model/Model.set_oseries /api/pastas/model/Model.get_tmin /api/pastas/model/Model.get_tmax /api/pastas/model/Model.get_init_parameters /api/pastas/model/Model.get_parameters /api/pastas/model/Model.get_stressmodel_names /api/pastas/model/Model.get_stressmodel_settings /api/pastas/model/Model.get_contribution /api/pastas/model/Model.get_contributions /api/pastas/model/Model.get_transform_contribution /api/pastas/model/Model.get_output_series /api/pastas/model/Model.get_block_response /api/pastas/model/Model.get_step_response /api/pastas/model/Model.get_response_tmax /api/pastas/model/Model.get_stress /api/pastas/model/Model.fit_report /api/pastas/model/Model.to_dict /api/pastas/model/Model.to_file /api/pastas/model/Model.copy .. py:class:: pastas.model.Model(oseries: pandas.Series, constant: bool = True, name: str | None = None, metadata: dict[str, Any] | None = None, freq: str = 'D') Class that initiates a Pastas time series model. :param oseries: pandas.Series object containing the dependent time series. The observation can be non-equidistant. :type oseries: pandas.Series :param constant: Add a constant to the model (Default=True). :type constant: bool, optional :param name: String with the name of the model, used in plotting and saving. :type name: str, optional :param metadata: 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. :type metadata: dict, optional :param freq: 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. :type freq: str, optional :returns: **ml** -- Pastas Model instance, the base object in Pastas. :rtype: pastas.model.Model .. rubric:: 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) .. !! processed by numpydoc !! .. py:property:: parameters :type: pandas.DataFrame Get the model parameters DataFrame. :returns: **parameters** -- DataFrame containing the model parameters. This is a read-only view; modifications to this DataFrame will not affect the model. :rtype: pandas.DataFrame .. rubric:: Notes The parameters attribute is read-only. To modify parameter properties, use the set_parameter method instead. .. seealso:: :py:obj:`set_parameter` Method to change parameter properties. .. !! processed by numpydoc !! .. py:property:: settings :type: dict[str, Any] Get the model settings dictionary. :returns: **settings** -- Dictionary containing the model settings. This is a read-only view; modifications to this dictionary will not affect the model. :rtype: dict .. rubric:: Notes The settings attribute is read-only. Model settings are automatically updated through methods like ml.solve() and ml.set_settings(). .. !! processed by numpydoc !! .. py:property:: time_offset :type: pandas.Timedelta Property to get the time offset from the settings. .. !! processed by numpydoc !! .. py:property:: sim_index :type: pandas.DatetimeIndex Property that returns the simulation index, including the warmup. Using the tmin, tmax, freq, and warmup from the model settings, a DatetimeIndex is created that includes the warmup period. This index is used for simulating the model and calculating the residuals. :returns: **sim_index** -- Pandas DatetimeIndex instance with the datetimes values for which the model is simulated. :rtype: pandas.DatetimeIndex .. !! processed by numpydoc !! Methods ------- .. autoapisummary:: pastas.model.Model.add_stressmodel pastas.model.Model.add_constant pastas.model.Model.add_transform pastas.model.Model.add_noisemodel pastas.model.Model.del_stressmodel pastas.model.Model.del_constant pastas.model.Model.del_transform pastas.model.Model.del_noisemodel pastas.model.Model.simulate pastas.model.Model.residuals pastas.model.Model.noise pastas.model.Model.observations pastas.model.Model.add_solver pastas.model.Model.solve pastas.model.Model.reset_settings pastas.model.Model.set_settings pastas.model.Model.set_parameter pastas.model.Model.set_oseries pastas.model.Model.get_tmin pastas.model.Model.get_tmax pastas.model.Model.get_init_parameters pastas.model.Model.get_parameters pastas.model.Model.get_stressmodel_names pastas.model.Model.get_stressmodel_settings pastas.model.Model.get_contribution pastas.model.Model.get_contributions pastas.model.Model.get_transform_contribution pastas.model.Model.get_output_series pastas.model.Model.get_block_response pastas.model.Model.get_step_response pastas.model.Model.get_response_tmax pastas.model.Model.get_stress pastas.model.Model.fit_report pastas.model.Model.to_dict pastas.model.Model.to_file pastas.model.Model.copy