Model¶
-
class
glotaran.model.base_model.
Model
[source]¶ Bases:
object
A base class for global analysis models.
Attributes Summary
The type of the model as human readable string.
Methods Summary
Creates a model from a dictionary.
Formats the model as Markdown string.
Returns a list with all problems in the model and missing parameters if specified.
Simulates the model.
Returns True if the number problems in the model is 0, else False
Returns a string listing all problems in the model and missing parameters if specified.
Methods Documentation
-
classmethod
from_dict
(model_dict_ref: dict) → glotaran.model.base_model.Model[source]¶ Creates a model from a dictionary.
- Parameters
model_dict – Dictionary containing the model.
-
property
index_dependent_matrix
¶
-
markdown
(parameters: Optional[glotaran.parameter.parameter_group.ParameterGroup] = None, initial_parameters: Optional[glotaran.parameter.parameter_group.ParameterGroup] = None) → str[source]¶ Formats the model as Markdown string.
Parameters will be included if specified.
- Parameters
parameter – Parameter to include.
initial – Initial values for the parameters.
-
property
model_type
¶ The type of the model as human readable string.
-
problem_list
(parameters: ParameterGroup = None) → list[str][source]¶ Returns a list with all problems in the model and missing parameters if specified.
- Parameters
parameter – The parameter to validate.
-
simulate
(dataset: str, parameters: ParameterGroup, axes: dict[str, np.ndarray] = None, clp: np.ndarray | xr.DataArray = None, noise: bool = False, noise_std_dev: float = 1.0, noise_seed: int = None) → xr.Dataset[source]¶ Simulates the model.
- Parameters
dataset – Label of the dataset to simulate.
parameter – The parameters for the simulation.
axes – A dictionary with axes for simulation.
clp – Conditionally linear parameters. Used instead of model.global_matrix if provided.
noise – If True noise is added to the simulated data.
noise_std_dev – The standard deviation of the noise.
noise_seed – Seed for the noise.
-
valid
(parameters: Optional[glotaran.parameter.parameter_group.ParameterGroup] = None) → bool[source]¶ Returns True if the number problems in the model is 0, else False
- Parameters
parameter – The parameter to validate.
-
validate
(parameters: Optional[glotaran.parameter.parameter_group.ParameterGroup] = None) → str[source]¶ Returns a string listing all problems in the model and missing parameters if specified.
- Parameters
parameter – The parameter to validate.
-
classmethod