unfix_parameters_to#

pharmpy.modeling.unfix_parameters_to(model, inits, strict=True)[source]#

Unfix parameters to

Unfix all listed parameters to specified value/values

Parameters:
  • model (Model) – Pharmpy model

  • inits (dict) – Inits for all parameters to unfix and change init

  • strict (bool) – Whether all parameters in input need to exist in the model. Default is True

Examples

>>> from pharmpy.modeling import fix_parameters, unfix_parameters_to, load_example_model
>>> model = load_example_model("pheno")
>>> model = fix_parameters(model, ['POP_CL', 'POP_VC'])
>>> model.parameters.fix    
{'POP_CL': True, 'POP_VC': True, 'COVAPGR': False, 'IIV_CL': False, 'IIV_VC': False, 'SIGMA': False}
>>> model = unfix_parameters_to(model, {'POP_CL': 0.5})
>>> model.parameters.fix        
{'POP_CL': False, 'POP_VC': True, 'COVAPGR': False, ...}
>>> model.parameters['POP_CL']
Parameter("POP_CL", 0.5, lower=0.0, upper=∞, fix=False)
Returns:

Model – Pharmpy model object

See also

fix_parameters

Fix parameters

fix_or_unfix_parameters

Fix or unfix parameters (given boolean)

unfix_paramaters

Unfixing parameters

fix_paramaters_to

Fixing parameters and setting a new initial estimate in the same function