calculate_eta_shrinkage#

pharmpy.modeling.calculate_eta_shrinkage(model, parameter_estimates, individual_estimates, sd=False)[source]#

Calculate eta shrinkage for each eta

Parameters:
  • model (Model) – Pharmpy model

  • parameter_estimates (pd.Series) – Parameter estimates

  • individual_estimates (pd.DataFrame) – Table of individual (eta) estimates

  • sd (bool) – Calculate shrinkage on the standard deviation scale (default is to calculate on the variance scale)

Returns:

Series – Shrinkage for each eta

Examples

>>> from pharmpy.modeling import *
>>> from pharmpy.tools import load_example_modelfit_results
>>> model = load_example_model("pheno")
>>> results = load_example_modelfit_results("pheno")
>>> pe = results.parameter_estimates
>>> ie = results.individual_estimates
>>> calculate_eta_shrinkage(model, pe, ie)
ETA_CL    0.720481
ETA_VC    0.240295
dtype: float64
>>> calculate_eta_shrinkage(model, pe, ie, sd=True)
ETA_CL    0.471305
ETA_VC    0.128389
dtype: float64