calculate_corr_from_inf#

pharmpy.modeling.calculate_corr_from_inf(information_matrix)[source]#

Calculate correlation matrix from an information matrix

Parameters:

information_matrix (pd.DataFrame) – Information matrix

Returns:

pd.DataFrame – Correlation matrix

Examples

>>> from pharmpy.modeling import load_example_model, calculate_corr_from_inf
>>> model = load_example_model("pheno")
>>> inf = model.modelfit_results.information_matrix
>>> inf
                  PTVCL          PTVV       THETA_3           IVCL           IVV      SIGMA_1_1
PTVCL      2.995567e+07  22660.028196  16057.855248  203511.614428 -39474.250514 -820118.299536
PTVV       2.266003e+04   2129.904642    260.176234    -375.266233  -2800.816246   -7718.769557
THETA_3    1.605786e+04    260.176234    187.038903     177.207683   -205.808480   -2225.150449
IVCL       2.035116e+05   -375.266233    177.207683    7527.530027   2462.974821   -9977.488860
IVV       -3.947425e+04  -2800.816246   -205.808480    2462.974821  22343.198618    9370.758371
SIGMA_1_1 -8.201183e+05  -7718.769557  -2225.150449   -9977.488860   9370.758371  249847.177845
>>> calculate_corr_from_inf(inf)
              PTVCL      PTVV   THETA_3      IVCL       IVV  SIGMA_1_1
PTVCL      1.000000  0.007099 -0.094640 -0.388059  0.097981   0.170820
PTVV       0.007099  1.000000 -0.356899  0.138062  0.356662   0.238441
THETA_3   -0.094640 -0.356899  1.000000 -0.096515 -0.062991   0.153616
IVCL      -0.388059  0.138062 -0.096515  1.000000 -0.185111   0.159170
IVV        0.097981  0.356662 -0.062991 -0.185111  1.000000  -0.027495
SIGMA_1_1  0.170820  0.238441  0.153616  0.159170 -0.027495   1.000000

See also

calculate_se_from_cov

Standard errors from covariance matrix

calculate_se_from_inf

Standard errors from information matrix

calculate_corr_from_cov

Correlation matrix from covariance matrix

calculate_cov_from_inf

Covariance matrix from information matrix

calculate_cov_from_corrse

Covariance matrix from correlation matrix and standard errors

calculate_inf_from_cov

Information matrix from covariance matrix

calculate_inf_from_corrse

Information matrix from correlation matrix and standard errors