pharmpy.results module

Options for the results module

Option name

Default value

Type

Description

native_shrinkage

True

bool

Should shrinkage calculation of external tool be used. Otherwise pharmpy will calculate shrinkage

class pharmpy.results.ChainedModelfitResults(results=None)[source]

Bases: collections.abc.MutableSequence, pharmpy.results.ModelfitResults

A sequence of modelfit results given in order from first to final inherits from both list and ModelfitResults. Each method from ModelfitResults will be performed on the final modelfit object

property correlation_matrix

The correlation matrix of the population parameter estimates

property covariance_matrix

The covariance matrix of the population parameter estimates

property evaluation_ofv

The ofv as if the model was evaulated

Currently works for classical estimation methods by taking the OFV of the first iteration.

property individual_estimates

Individual parameter estimates

A DataFrame with ID as index one column for each individual parameter

property individual_estimates_covariance

The covariance matrix of the individual estimates

property individual_ofv

A Series with individual estimates indexed over ID

property information_matrix

The Fischer information matrix of the population parameter estimates

insert(ind, value)[source]

S.insert(index, value) – insert value before index

property minimization_successful

Was the minimization successful

property model_name
property ofv

Final objective function value

property parameter_estimates

Parameter estimates as series

property parameter_estimates_sdcorr
plot_iofv_vs_iofv(other)[source]
property predictions
property residuals
property runtime_total
property standard_errors

Standard errors of population parameter estimates

property standard_errors_sdcorr
class pharmpy.results.ModelfitResults(ofv=None, parameter_estimates=None, covariance_matrix=None, standard_errors=None, minimization_successful=None, individual_ofv=None, individual_estimates=None, runtime_total=None)[source]

Bases: pharmpy.results.Results

Base class for results from a modelfit operation

properties: individual_OFV is a df with currently ID and iOFV columns

model_name - name of model that generated the results model

property aic

Final AIC value assuming the OFV to be -2LL

property bic

Final BIC value assuming the OFV to be -2LL

property correlation_matrix

The correlation matrix of the population parameter estimates

property covariance_matrix

The covariance matrix of the population parameter estimates

eta_shrinkage(sd=False)[source]

Eta shrinkage for each eta

Variance = False to get sd scale

property evaluation_ofv

The ofv as if the model was evaulated

Currently works for classical estimation methods by taking the OFV of the first iteration.

property individual_estimates

Individual parameter estimates

A DataFrame with ID as index one column for each individual parameter

property individual_estimates_covariance

The covariance matrix of the individual estimates

property individual_ofv

A Series with individual estimates indexed over ID

property information_matrix

The Fischer information matrix of the population parameter estimates

property minimization_successful

Was the minimization successful

near_bounds(zero_limit=0.001, significant_digits=2)[source]
property ofv

Final objective function value

property parameter_estimates

Parameter estimates as series

parameter_summary()[source]

Summary of parameter estimates and uncertainty

plot_individual_predictions(predictions=None, individuals=None)[source]

Plot DV and predictions grouped on individuals

Parameters
  • predictions (list) – A list of names of predictions to plot. None for all available

  • individuals (list) – A list of individuals to include. None for all individuals

plot_iofv_vs_iofv(other)[source]
property relative_standard_errors

Relative standard errors of population parameter estimates

property runtime_total
property standard_errors

Standard errors of population parameter estimates

to_dict()[source]

Convert results object to a dictionary

class pharmpy.results.Results[source]

Bases: object

Base class for all result classes

add_plots()[source]

Create and add all plots to results object

create_report(path)[source]
classmethod from_dict(d)[source]
get_and_reset_index(attr, **kwargs)[source]

Wrapper to reset index of attribute or result from method.

Used to facilitate importing multiindex dataframes into R

to_csv(path)[source]

Save results as a human readable csv file

Index will not be printed if it is a basic range.

to_dict()[source]

Convert results object to a dictionary

to_json(path=None, lzma=False)[source]
class pharmpy.results.ResultsConfiguration[source]

Bases: pharmpy.config.Configuration

module = 'pharmpy.results'

This setting should be moved to the NONMEM plugin

Type

FIXME

native_shrinkage

Use shrinkage results from external tool

class pharmpy.results.ResultsJSONDecoder(*args, **kwargs)[source]

Bases: json.decoder.JSONDecoder

object_hook(dct)[source]
class pharmpy.results.ResultsJSONEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]

Bases: json.encoder.JSONEncoder

default(obj)[source]

Implement this method in a subclass such that it returns a serializable object for o, or calls the base implementation (to raise a TypeError).

For example, to support arbitrary iterators, you could implement default like this:

def default(self, o):
    try:
        iterable = iter(o)
    except TypeError:
        pass
    else:
        return list(iterable)
    # Let the base class default method raise the TypeError
    return JSONEncoder.default(self, o)
pharmpy.results.read_results(path_or_buf)[source]

Inheritance Diagram

Inheritance diagram of pharmpy.results