addLogEstimates: Add log estimates to a model

View source: R/transPk.R

addLogEstimatesR Documentation

Add log estimates to a model

Description

Add log estimates to a model

Usage

addLogEstimates(ui, vars, extraLines = NULL, beforeCmt = NULL)

Arguments

ui

rxode2 model

vars

estimates to add they will be parameterized as:

var <- exp(lvar)

where var is the variable name in the model and lvar is the log transformed variable that will be estimated

extraLines

this is a list of additional lines to add to the model just after the variables are defined. It must be NULL or a list of language objects.

beforeCmt

if the model is compartmental you can specify the preferred names where the estimates and extra lines are added before

Value

rxode2 model with log estimates added (and possibly extra lines)

Author(s)

Matthew L. Fidler

Examples


# Change the transformation of the PK model from cl to k

readModelDb("PK_3cmt_des") |>
  removeLinesAndInis(c("kel", "k12", "k21", "k13", "k31", "vc")) |>
  addLogEstimates(c("kel", "k12", "k21", "k13", "k31", "vc"))

# You can also label the parameters by using a named character
# vector with the names of the parameters representing the
# variables and the values representing the labels:

readModelDb("PK_3cmt_des") |>
  removeLinesAndInis(c("kel", "k12", "k21", "k13", "k31", "vc")) |>
  addLogEstimates(c(kel="elimination", k12="k12 constant",
                    k21="k21 constant",
                    k13="k13 constant",
                    k31="k31 constant",
                    vc="volume of central compartment"))


nlmixr2lib documentation built on Oct. 7, 2024, 5:08 p.m.