Solving#
- calculate_fisher_criterion(fsmp: ~eDPM.model.fisher_model.FisherModelParametrized, criterion=<function fisher_determinant>, relative_sensitivities=False, verbose=False)#
Calculate the Fisher information optimality criterion for a chosen Fisher model.
- Parameters:
fsmp (FisherModelParametrized) – The parametrized FisherModel with a chosen values for the sampled variables.
criterion (callable) –
Choose the optimality criterion to determine the objective function and quantify the Experimental Design. The default is “fisher_determinant”.
- fisher_determinant
Use the D-optimality criterion that maximizes the determinant of the Fisher Information matrix.
- fisher_mineigenval
Use the E-optimality criterion that maximizes the minimal eigenvalue of the Fisher Information matrix.
- fisher_sumeigenval
Use the A-optimality criterion that maximizes the sum of all eigenvalues of the Fisher Information matrix.
- fisher_ratioeigenval
Use the modified E-optimality criterion that maximizes the ratio of the minimal and maximal eigenvalues of the Fisher Information matrix.
relative_sensitivities (bool, optional) – Use relative local sensitivities \(s_{ij} = \dfrac{\partial y_i}{\partial p_j} \dfrac{p_j}{y_i}\) instead of absolute. Defaults to False.
- Returns:
The result of the Fisher information optimality criterion represented as a FisherResults object.
- Return type:
- get_S_matrix(fsmp: FisherModelParametrized, relative_sensitivities=False, **kwargs)#
Calculate the sensitivity matrix for a Fisher Model.
- Parameters:
fsmp (FisherModelParametrized) – The parametrized FisherModel with a chosen values for the sampled variables.
relative_sensitivities (bool, optional) – Use relative local sensitivities \(s_{ij} = \frac{\partial y_i}{\partial p_j} \frac{p_j}{y_i}\) instead of absolute. Defaults to False.
- Returns:
The sensitivity matrix S, the cobvariance matrix C, the object of type FisherResultSingle with ODEs solutions.
- Return type:
np.ndarray, np.ndarray, FisherResultSingle
- ode_rhs(t, x, ode_fun, ode_dfdx, ode_dfdp, ode_dfdx0, inputs, parameters, ode_args, n_x, n_p)#
Calculate the right-hand side of the ODEs system, containing the model definition with state variables \(\dot x = f(x, t, u, u, c)\) and the equations for the local sensitivities \(\dot s = \frac{\partial f}{\partial x} s + \frac{\partial f}{\partial p}\).
- Parameters:
t (np.ndarray) – The measurement times \(t\).
x (np.ndarray) – The array containing the state variables \(x\) and sensitivities \(s\).
ode_fun (callable) – The ODEs right-hand side function \(f\) for the state variables \(x\).
ode_dfdx (callable) – The derivative of the ODEs function with respect to state variables \(x\).
ode_dfdp (callable) – The derivative of the ODEs function with respect to parameters \(p\).
inputs (list) – The inputs of the system.
parameters – The estimated parameters of the system \(p\).
ode_args (tuple) – The ode_args of the system \(c\).
n_x (int) – The number of the state variables of the system.
n_p (int) – The number of the estimated parameters of the system.
- Returns:
The right-hand side of the ODEs system for sensitivities calculation.
- Return type:
np.ndarray
- fisher_determinant(fsmp: FisherModelParametrized, S, C)#
Calculate the determinant of the Fisher information matrix (the D-optimality criterion) using the sensitivity matrix.
- Parameters:
fsmp (FisherModelParametrized) – The parametrized FisherModel with a chosen values for the sampled variables.
S (np.ndarray) – The sensitivity matrix.
C (np.ndarray) – The covariance matrix of the measurement errors.
- Returns:
The determinant of the Fisher information matrix.
- Return type:
float
- fisher_mineigenval(fsmp: FisherModelParametrized, S, C)#
Calculate the minimal eigenvalue of the Fisher information matrix (the E-optimality criterion) using the sensitivity matrix.
- Parameters:
fsmp (FisherModelParametrized) – The parametrized FisherModel with a chosen values for the sampled variables.
S (np.ndarray) – The sensitivity matrix.
C (np.ndarray) – The covariance matrix of the measurement errors.
- Returns:
The minimal eigenvalue of the Fisher information matrix.
- Return type:
float
- fisher_ratioeigenval(fsmp: FisherModelParametrized, S, C)#
Calculate the ratio of the minimal and maximal eigenvalues of the Fisher information matrix (the modified E-optimality criterion) using the sensitivity matrix.
- Parameters:
fsmp (FisherModelParametrized) – The parametrized FisherModel with a chosen values for the sampled variables.
S (np.ndarray) – The sensitivity matrix.
C (np.ndarray) – The covariance matrix of the measurement errors.
- Returns:
The ratio of the minimal and maximal eigenvalues of the Fisher information matrix.
- Return type:
float
- fisher_sumeigenval(fsmp: FisherModelParametrized, S, C)#
Calculate the sum of the all eigenvalues of the Fisher information matrix (the A-optimality criterion) using the sensitivity matrix.
- Parameters:
fsmp (FisherModelParametrized) – The parametrized FisherModel with a chosen values for the sampled variables.
S (np.ndarray) – The sensitivity matrix.
C (np.ndarray) – The covariance matrix of the measurement errors.
- Returns:
The sum of the eigenvalues of the Fisher information matrix.
- Return type:
float
- display_entries(table, terminal_size, caption=None)#
- display_fsmp_details(fsmp: ~eDPM.model.fisher_model.FisherModelParametrized, pp=<pprint.PrettyPrinter object>, terminal_size=(80, 20))#
- display_fsr_details(fsr: ~eDPM.model.fisher_model.FisherResults, pp=<pprint.PrettyPrinter object>, terminal_size=(80, 20))#
- display_heading(string, terminal_size=(80, 20))#
- generate_matrix_cols(M, name, terminal_size=(80, 20))#