split_joint_distribution#

pharmpy.modeling.split_joint_distribution(model, rvs=None)[source]#

Splits etas following a joint distribution into separate distributions.

Parameters:
  • model (Model) – Pharmpy model

  • rvs (str, list) – Name/names of etas to separate. If None, all etas that are IIVs and non-fixed will become single. None is default.

Returns:

Model – Pharmpy model object

Examples

>>> from pharmpy.modeling import *
>>> model = load_example_model("pheno")
>>> model = create_joint_distribution(model, ['ETA_CL', 'ETA_VC'])
>>> model.random_variables.etas
⎡ETA_CL⎤    ⎧⎡0⎤  ⎡   IIV_CL      IIV_CL_IIV_VC⎤⎫
⎢      ⎥ ~ N⎪⎢ ⎥, ⎢                            ⎥⎪
⎣ETA_VC⎦    ⎩⎣0⎦  ⎣IIV_CL_IIV_VC     IIV_VC    ⎦⎭
>>> model = split_joint_distribution(model, ['ETA_CL', 'ETA_VC'])
>>> model.random_variables.etas
ETA_CL ~ N(0, IIV_CL)
ETA_VC ~ N(0, IIV_VC)

See also

create_joint_distribution

combine etas into a join distribution