Parameter transformation

Description

Parameter transformation

Usage

1
2
Pexpl(trafo, parameters = NULL, 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.

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

1
2
3
4
5
6
7
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)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.