GroupedProblem¶
- class glotaran.analysis.problem_grouped.GroupedProblem(scheme: glotaran.project.scheme.Scheme)[source]¶
Bases:
glotaran.analysis.problem.Problem
Represents a problem where the data is grouped.
Initializes the Problem class from a scheme (
glotaran.analysis.scheme.Scheme
)- Args:
- scheme (Scheme): An instance of
glotaran.analysis.scheme.Scheme
which defines your model, parameters, and data
- scheme (Scheme): An instance of
Attributes Summary
Property providing access to the used model
Property providing access to the used scheme
Methods Summary
Calculates additional penalties by calling the model.additional_penalty function.
Calculates the index dependent model matrices.
Calculates the index dependent residuals.
Calculates the index independent model matrices.
Calculates the index independent residuals.
Creates a result datasets for index dependent matrices.
Creates a result datasets for index independent matrices.
Initializes a grouped problem bag.
Resets all results and DatasetDescriptors.
Methods Documentation
- property additional_penalty: dict[str, list[float]]¶
- property bag: UngroupedBag | GroupedBag¶
- calculate_additional_penalty() np.ndarray | dict[str, np.ndarray] ¶
Calculates additional penalties by calling the model.additional_penalty function.
- calculate_index_dependent_matrices() tuple[dict[str, list[list[str]]], dict[str, list[np.ndarray]], list[list[str]], list[np.ndarray]] [source]¶
Calculates the index dependent model matrices.
- calculate_index_dependent_residual() tuple[list[np.ndarray], list[np.ndarray], list[np.ndarray], list[np.ndarray]] [source]¶
Calculates the index dependent residuals.
- calculate_index_independent_matrices() tuple[dict[str, list[str]], dict[str, np.ndarray], dict[str, LabelAndMatrix]] [source]¶
Calculates the index independent model matrices.
- calculate_index_independent_residual() tuple[list[np.ndarray], list[np.ndarray], list[np.ndarray], list[np.ndarray]] [source]¶
Calculates the index independent residuals.
- calculate_matrices()¶
- calculate_residual()¶
- property clp_labels: dict[str, list[str] | list[list[str]]]¶
- property clps: dict[str, list[np.ndarray]]¶
- property cost: float¶
- create_index_dependent_result_dataset(label: str, dataset: xarray.core.dataset.Dataset) xarray.core.dataset.Dataset [source]¶
Creates a result datasets for index dependent matrices.
- create_index_independent_result_dataset(label: str, dataset: xarray.core.dataset.Dataset) xarray.core.dataset.Dataset [source]¶
Creates a result datasets for index independent matrices.
- property data: dict[str, xr.Dataset]¶
- property filled_dataset_descriptors: dict[str, DatasetDescriptor]¶
- property full_penalty: numpy.ndarray¶
- property grouped: bool¶
- property groups: dict[str, list[str]]¶
- property index_dependent: bool¶
- property matrices: dict[str, np.ndarray | list[np.ndarray]]¶
- property model: glotaran.model.base_model.Model¶
Property providing access to the used model
The model is a subclass of
glotaran.model.Model
decorated with the @model decoratorglotaran.model.model_decorator.model
For an example implementation see e.g.glotaran.builtin.models.kinetic_spectrum
- Returns:
- Model: A subclass of
glotaran.model.Model
The model must be decorated with the @model decorator
glotaran.model.model_decorator.model
- Model: A subclass of
- property parameter_history: list[ParameterGroup]¶
- property parameters: glotaran.parameter.parameter_group.ParameterGroup¶
- property reduced_clp_labels: dict[str, list[str] | list[list[str]]]¶
- property reduced_clps: dict[str, list[np.ndarray]]¶
- property reduced_matrices: dict[str, np.ndarray] | dict[str, list[np.ndarray]] | list[np.ndarray]¶
- reset()¶
Resets all results and DatasetDescriptors. Use after updating parameters.
- property residuals: dict[str, list[np.ndarray]]¶
- save_parameters_for_history()¶
- property scheme: glotaran.project.scheme.Scheme¶
Property providing access to the used scheme
- Returns:
- Scheme: An instance of
glotaran.analysis.scheme.Scheme
Provides access to data, model, parameters and optimization arguments.
- Scheme: An instance of
- property weighted_residuals: dict[str, list[np.ndarray]]¶