tweak: Adjust Values

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

Description

tweak is generic. Methods currently exist for classes init, initList, and nmctl. For the latter, to "tweak" a control stream means to jitter the initial estimates. By default, the estimate itself is scaled by a value drawn at random from a normal distribution centered at 1 with standard deviation sd. The default of 0.13 gives about +/- 10 percent change, on average.

Usage

1
2
3
4
5
6
## S3 method for class 'init'
tweak(x,sd=0.13,digits=3,...)
## S3 method for class 'initList'
tweak(x,sd=0.13,digits=3,...)
## S3 method for class 'nmctl'
tweak(x,sd=0.13,digits=3,...)

Arguments

x

object of interest

sd

passed to rnorm

digits

passed to signif

...

passed to other functions

Details

If the tweaked value exceeds one of the bounds, another draw is taken by recursion. To clear all bounds, set fixed to TRUE and then FALSE successively.

Value

object of class init, or a numbered set of these, having class initList.

Author(s)

Tim Bergsma

References

http://metrumrg.googlecode.com

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
path <- system.file('example/project/nonmem/ctl/1005.ctl',package='metrumrg')
ctl <- read.nmctl(path,parse=TRUE)
ctl$theta[] <- lapply(ctl$theta,`comment<-`,value=NULL)
set.seed(0)
tweak(ctl$theta)
x <- as.initList('(0,3) 2 FIXED (0 .6 1) 10 (-INF,-2.7,0) (37 FIXED) ')
x
fixed(x)
fixed(x) <- TRUE
fixed(x) <- FALSE
tweak(x)

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