Pexpl {dMod}R Documentation

Parameter transformation

Description

Parameter transformation

Usage

Pexpl(
  trafo,
  parameters = NULL,
  attach.input = FALSE,
  condition = NULL,
  compile = FALSE,
  modelname = NULL,
  verbose = FALSE
)

Arguments

trafo

Named character vector. Names correspond to the parameters being fed into the model (the inner parameters). The elements of tafo are equations that express the inner parameters in terms of other parameters (the outer parameters)

parameters

Character vector. Optional. If given, the generated parameter transformation returns values for each element in parameters. If elements of parameters are not in names(trafo) the identity transformation is assumed.

attach.input

attach those incoming parameters to output which are not overwritten by the parameter transformation.

condition

character, the condition for which the transformation is generated

compile

Logical, compile the function (see funC0)

modelname

Character, used if compile = TRUE, sets a fixed filename for the C file.

verbose

Print compiler output to R command line.

Value

a function p2p(p, fixed = NULL, deriv = TRUE) representing the parameter transformation. Here, p is a named numeric vector with the values of the outer parameters, fixed is a named numeric vector with values of the outer parameters being considered as fixed (no derivatives returned) and deriv is a logical determining whether the Jacobian of the parameter transformation is returned as attribute "deriv".

See Also

Pimpl for implicit parameter transformations

Examples


logtrafo <- c(k1 = "exp(logk1)", k2 = "exp(logk2)", 
              A = "exp(logA)", B = "exp(logB)")
p_log <- P(logtrafo)

pars <- c(logk1 = 1, logk2 = -1, logA = 0, logB = 0)
out <- p_log(pars)
getDerivs(out)

[Package dMod version 1.0.2 Index]