fix_or_unfix_parameters#

pharmpy.modeling.fix_or_unfix_parameters(model, parameters, strict=True)[source]#

Fix or unfix parameters

Set fixedness of parameters to specified values

Parameters:
  • model (Model) – Pharmpy model

  • parameters (dict) – Set fix/unfix for these parameters

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

Examples

>>> from pharmpy.modeling import fix_or_unfix_parameters, load_example_model
>>> model = load_example_model("pheno")
>>> model.parameters['POP_CL']
Parameter("POP_CL", 0.00469307, lower=0.0, upper=∞, fix=False)
>>> model = fix_or_unfix_parameters(model, {'POP_CL': True})
>>> model.parameters['POP_CL']
Parameter("POP_CL", 0.00469307, lower=0.0, upper=∞, fix=True)
Returns:

Model – Pharmpy model object

See also

fix_parameters

Fix parameters

unfix_paramaters

Unfixing parameters

fix_paramaters_to

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

unfix_paramaters_to

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