Result¶
-
class
glotaran.analysis.result.
Result
(scheme: Scheme, data: dict[str, xr.Dataset], optimized_parameters: ParameterGroup, additional_penalty: np.ndarray | None, least_squares_result: OptimizeResult, free_parameter_labels: list[str], termination_reason: str)[source]¶ Bases:
object
The result of a global analysis
- Parameters
scheme (Scheme) – An analysis scheme
data (Dict[str, xr.Dataset]) – A dictionary containing all datasets with their labels as keys.
optimized_parameters (ParameterGroup) – The optimized parameters, organized in a
ParameterGroup
additional_penalty (Union[np.ndarray, None]) – A vector with the value for each additional penalty, or None
least_squares_result (OptimizeResult) – See
scipy.optimize.OptimizeResult()
scipy.optimize.least_squares()
free_parameter_labels (List[str]) – The text labels of the free parameters that were optimized
termination_reason (str) – The reason (message when) the optimizer terminated
Attributes Summary
The additional penalty vector.
The chi-square of the optimization.
Covariance matrix.
The resulting data as a dictionary of xarray.Dataset.
Degrees of freedom in optimization .
List of labels of the free parameters used in optimization.
The initital parameters.
Modified Jacobian matrix at the solution See also:
scipy.optimize.least_squares()
The model for analysis.
If True non-negative least squares optimization is used instead of the default variable projection.
Number of data points .
The number of function evaluations.
The number of jacobian evaluations.
Number of variables in optimization
The optimized parameters.
The reduced chi-square of the optimization.
The root mean square error the optimization.
The scheme for analysis.
Indicates if the optimization was successful.
The reason of the termination of the process.
Methods Summary
Returns the result dataset for the given dataset label.
Return a new scheme from the Result object with optimized parameters.
Formats the model as a markdown text.
Saves the result to given folder.
Methods Documentation
-
property
additional_penalty
¶ The additional penalty vector.
-
property
chi_square
¶ The chi-square of the optimization.
.
-
property
covariance_matrix
¶ Covariance matrix.
The rows and columns are corresponding to
free_parameter_labels
.
-
property
data
¶ The resulting data as a dictionary of xarray.Dataset.
Notes
The actual content of the data depends on the actual model and can be found in the documentation for the model.
-
property
degrees_of_freedom
¶ Degrees of freedom in optimization .
-
property
free_parameter_labels
¶ List of labels of the free parameters used in optimization.
-
get_dataset
(dataset_label: str) → xarray.core.dataset.Dataset[source]¶ Returns the result dataset for the given dataset label.
- Parameters
dataset_label – The label of the dataset.
-
get_scheme
() → glotaran.analysis.scheme.Scheme[source]¶ Return a new scheme from the Result object with optimized parameters.
- Returns
A new scheme with the parameters set to the optimized values. For the dataset weights the (precomputed) weights from the original scheme are used.
- Return type
-
property
initial_parameters
¶ The initital parameters.
-
property
jacobian
¶ Modified Jacobian matrix at the solution See also:
scipy.optimize.least_squares()
- Returns
Numpy array
- Return type
np.ndarray
-
markdown
(with_model=True) → str[source]¶ Formats the model as a markdown text.
- Parameters
with_model – If True, the model will be printed with initial and optimized parameters filled in.
-
property
model
¶ The model for analysis.
-
property
nnls
¶ If True non-negative least squares optimization is used instead of the default variable projection.
-
property
number_of_data_points
¶ Number of data points .
-
property
number_of_function_evaluations
¶ The number of function evaluations.
-
property
number_of_jacobian_evaluations
¶ The number of jacobian evaluations.
-
property
number_of_variables
¶ Number of variables in optimization
-
property
optimized_parameters
¶ The optimized parameters.
-
property
reduced_chi_square
¶ The reduced chi-square of the optimization.
.
-
property
root_mean_square_error
¶ The root mean square error the optimization.
-
save
(path: str) → list[str][source]¶ Saves the result to given folder.
Returns a list with paths of all saved items.
The following files are saved:
result.md: The result with the model formatted as markdown text.
optimized_parameters.csv: The optimized parameter as csv file.
{dataset_label}.nc: The result data for each dataset as NetCDF file.
- Parameters
path – The path to the folder in which to save the result.
-
property
scheme
¶ The scheme for analysis.
-
property
success
¶ Indicates if the optimization was successful.
-
property
termination_reason
¶ The reason of the termination of the process.