conv: Convert between parameterisations

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/conv.R

Description

This function is used by cqmc to convert between parameterisations. Optionally includes determinant required by cqmc.

Usage

1
conv(pars, from = "m", to = "c", det = FALSE)

Arguments

pars

vector of parameters with names

from

"m", "p" or "c" represents initial parameterisation

to

"m", "p" or "c" represents final parameterisation

det

logical, if TRUE then output is list with determinant of transformation

Details

"c" and cpars represent calculation pars (includes lambda used in CMP distribution).
"p" and pars represent original pars (includes mu, parameter of interest).
"m" and mpars represent pars transformed to find mode using optim and to run MCMC.

Value

If det is FALSE then transformed vector.

If det is TRUE then a list with:

new.pars

The transformed vector

dfac

The absolute value of the determinant of the transformation if from is "m" and to is "c" and NA otherwise

Author(s)

Philip Wilson

See Also

conv.mcmc

Examples

1
2
3
4
5
6
7
8
pars<-c(mu=1.5,E=0.95,A=10^-15,trendx=10^-3,
 trendy=-10^-3,E1=0.8,disp=1.5)

mpars<-conv(pars,"p","m")

cpars<-conv(mpars,"m","c",det=TRUE)

conv(cpars[[1]],"c","p")

edpcr documentation built on May 2, 2019, 5:22 p.m.