Diagnostic model classes

class midas.models.DiagnosticModel

An abstract base-class for diagnostic models.

abstractmethod predictions(**parameters_and_fields)

Calculate the model predictions of the measured diagnostic data.

Parameters:

parameters_and_fields (ndarray) –

The parameter and field values requested via the ParameterVector and FieldRequest objects stored in parameters and fields instance variables.

The names of the unpacked keyword arguments correspond to the name attribute of the ParameterVector and FieldRequest objects, and their values will be passed as 1D arrays.

Returns:

The model predictions of the measured diagnostic data as a 1D array.

Return type:

ndarray

abstractmethod predictions_and_jacobians(**parameters_and_fields)

Calculate the model predictions of the measured diagnostic data, and the Jacobians of the predictions with respect to the given parameter and field values.

Parameters:

parameters_and_fields (ndarray) –

The parameter and field values requested via the ParameterVector and FieldRequest objects stored in parameters and field_requests instance variables.

The names of the unpacked keyword arguments correspond to the name attribute of the ParameterVector and FieldRequest objects, and their values will be passed as 1D arrays.

Returns:

The model predictions of the measured diagnostic data as a 1D array, followed by the Jacobians of the predictions with respect to the given parameter and field values.

The Jacobians must be returned as a dictionary mapping the parameter and field names to the corresponding Jacobians as 2D arrays.

Return type:

tuple[ndarray, dict[str, ndarray]]

class midas.models.LinearDiagnosticModel(field, model_matrix)

A class for purely linear diagnostic models, where the model predictions are obtained from the product of a model matrix and a vector of field values.

Parameters:
  • field (FieldRequest) – A FieldRequest specifying the vector of field values which will be multiplied by the given model_matrix.

  • model_matrix (ndarray) – A matrix which will multiply the vector of requested field values in order to produce the model predictions.