repar: Reparameterization

Description Usage Arguments Details Value Examples

View source: R/parameters.R

Description

Reparameterization

Usage

1
repar(expr, trafo = NULL, ..., reset = FALSE)

Arguments

expr

character of the form "lhs ~ rhs" where rhs reparameterizes lhs. Both lhs and rhs can contain a number of symbols whose values need to be passed by the ... argument.

trafo

character or equation vector or list thereof. The object where the replacement takes place in

...

pass symbols as named arguments

reset

logical. If true, the trafo element corresponding to lhs is reset according to rhs. If false, lhs wherever it occurs in the rhs of trafo is replaced by rhs of the formula.

Details

Left and right-hand side of expr are searched for symbols. If separated by "_", symbols are recognized as such, e.g. in Delta_x where the symbols are "Delta" and "x". Each symbol for which values (character or numbers) are passed by the ... argument is replaced.

Value

an equation vector with the reparameterization.

Examples

1
2
3
4
5
6
7
8
innerpars <- letters[1:3]
constraints <- c(a = "b + c")
mycondition <- "cond1"

trafo <- repar("x ~ x", x = innerpars)
trafo <- repar("x ~ y", trafo, x = names(constraints), y = constraints)
trafo <- repar("x ~ exp(x)", trafo, x = innerpars)
trafo <- repar("x ~ x + Delta_x_condition", trafo, x = innerpars, condition = mycondition)

dMod documentation built on Jan. 27, 2021, 1:07 a.m.