simpar: Create Parameters for Simulation with Uncertainty

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

Description

Given the parameter estimates of a mixed effect model, this function generates sets of parameters for simulation. Each set takes into account the relevant variance-covariance structure of the fixed effects and random effects. Two levels of random effects are supported, following the naming conventions of NONMEM.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
simpar(
	nsim, 
	theta, 
	covar, 
	omega, 
	sigma, 
	odf = NULL, 
	sdf = NULL, 
	digits = 4, 
	min = -Inf, 
	max = Inf
)

Arguments

nsim

scalar numeric specifying the number of sets to attempt

theta

vector of point estimates of fixed effect parameters

covar

variance-covariance matrix for fixed effect parameters

omega

list of variance-covariance matrices for first level random effects

sigma

list of variance-covariance matrices for second level random effects

odf

vector of omega degrees of freedom, one per matrix

sdf

vector of sigma degrees of freedom, one per matrix

digits

number of significant digits to include in output

min

lower limit for parameter estimates

max

upper limit for parameter estimates

Details

If min or max are non-default (see below), you may want to set nsim marginally higher to allow for dropped sets.

covar is coerced to matrix using as.matrix.

If omega and sigma are not lists, they are coerced using list. Then each element is coerced using as.matrix.

By default, each element in odf and sdf will be the length (number of elements) in the corresponding matrix.

min and max may be given as scalar values, in which case they apply to all parameters (as do the defaults). Alternatively, the first n limits may be specified as a vector, in which case the remaining (if any) will be the default. If any simulated parameter does not fall between its limits, inclusive, the entire parameter set (row) is dropped from the result, with warning.

Value

matrix, with column names indicating parameters, and row names indicating set number before filtering by min and max.

Author(s)

Tim Bergsma

References

http://metrumrg.googlecode.com http://www.page-meeting.org/page/page2006/P2006III_11.pdf

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
## Not run: metrumrgURL('example/project/script/simpar.pdf')

set.seed(100)
simpar(
    nsim=10,
    theta=c(13,75,1),
    covar=matrix(c(10,7,2,7,30,1,2,1,0.5),ncol=3,nrow=3),
    omega=list(
	0.1,
	matrix(c(0.04,0.02,0.02,0.04),ncol=2,nrow=2)
    ),
    odf=c(50,20),
    sigma=list(0.04,1),
    sdf=c(99,99),
    min=rep(0,3),
    max=rep(90,3)
)
simpar(
    nsim=1,
    theta=c(13,75,1),
    covar=matrix(c(10,7,2,7,30,1,2,1,0.5),ncol=3,nrow=3),
    omega=list(
	0.1,
	matrix(c(0.04,0.02,0.02,0.04),ncol=2,nrow=2)
    ),
    odf=c(50,20),
    sigma=list(0.04,1),
    sdf=c(99,99),
    min=rep(0,3),
    max=rep(90,3)
)
simpar(
    nsim=1,
    theta=c(13,75,1),
    covar=matrix(c(10,7,2,7,30,1,2,1,0.5),ncol=3,nrow=3),
    omega=list(
	0.1,
	matrix(c(0.04,0.02,0.02,0.04),ncol=2,nrow=2)
    ),
    odf=c(50,20),
    sigma=list(0.04,1),
    sdf=c(99,99),
    min=Inf,
    max=-1
)

metrumrg documentation built on May 2, 2019, 5:55 p.m.