Model#

class pharmpy.Model[source]#

Bases: object

The Pharmpy model class

Attributes Summary

datainfo

Definitions of model statements

dataset

Dataset connected to model

dependent_variable

The model dependent variable, i.e. y.

description

A free text discription of the model

estimation_steps

Definitions of estimation steps

filename_extension

Filename extension of model file

initial_individual_estimates

Initial estimates for individual parameters

model_code

Model type specific code

modelfit_results

Modelfit results for this model

name

Name of the model

observation_transformation

Transformation to be applied to the observation data

parameters

Definitions of population parameters

parent_model

Name of parent model

random_variables

Definitions of random variables

statements

Definitions of model statements

value_type

The type of the model value (dependent variable)

Methods Summary

copy()

Create a deepcopy of the model object

create_model([obj])

Factory for creating a pharmpy.model object from an object representing the model

has_same_dataset_as(other)

Check if this model has the same dataset as another model

read_modelfit_results(path)

Read in modelfit results

update_datainfo()

Update model.datainfo for a new dataset

Attributes Documentation

datainfo#

Definitions of model statements

See pharmpy.Statements

dataset#

Dataset connected to model

dependent_variable#

The model dependent variable, i.e. y

description#

A free text discription of the model

estimation_steps#

Definitions of estimation steps

See pharmpy.EstimationSteps

filename_extension#

Filename extension of model file

initial_individual_estimates#

Initial estimates for individual parameters

model_code#

Model type specific code

modelfit_results#

Modelfit results for this model

name#

Name of the model

observation_transformation#

Transformation to be applied to the observation data

parameters#

Definitions of population parameters

See pharmpy.Parameters

parent_model#

Name of parent model

random_variables#

Definitions of random variables

See pharmpy.RandomVariables

statements#

Definitions of model statements

See pharmpy.Statements

value_type#

The type of the model value (dependent variable)

By default this is set to ‘PREDICTION’ to mean that the model outputs a prediction. It could optionally be set to ‘LIKELIHOOD’ or ‘-2LL’ to let the model output the likelihood or -2*log(likelihood) of the prediction. If set to a symbol this variable can be used to change the type for different records. The model would then set this symbol to 0 for a prediction value, 1 for likelihood and 2 for -2ll.

Methods Documentation

copy()[source]#

Create a deepcopy of the model object

static create_model(obj=None, **kwargs)[source]#

Factory for creating a pharmpy.model object from an object representing the model

Parameters:

objpath-like object pointing to the model file or an IO object.

Returns:

Model – Generic Model if obj is None, otherwise appropriate implementation is invoked (e.g. NONMEM7 Model).

has_same_dataset_as(other)[source]#

Check if this model has the same dataset as another model

Parameters:

other (Model) – Another model

Returns:

bool – True if both models have the same dataset

read_modelfit_results(path: Path)[source]#

Read in modelfit results

update_datainfo()[source]#

Update model.datainfo for a new dataset