R: Run sensitivity analysis on model settings

knobs {mrgsolve} | R Documentation

## Run sensitivity analysis on model settings

### Description

Knobs can be parameter values or PK dosing items (e.g. amt). By design, all combinations of specified knob/values are simulated.

### Usage

    knobs(x, y, ...)

    ## S4 method for signature 'mrgmod,missing'
    knobs(x, y, ...)

    ## S4 method for signature 'mrgmod,batch_mrgsims'
    knobs(x, y, ...)

    ## S4 method for signature 'batch_mrgsims'
    as.data.frame(x, row.names = NULL, optional = FALSE, ...)

    ## S4 method for signature 'batch_mrgsims,ANY'
    knobs(x, y, ...)

    ## S4 method for signature 'batch_mrgsims'
    show(object)

### Arguments

`x` | the model object
`y` | a `batch_mrgsims` object
`...` | knobs: named numeric vectors that identify knob names and knob values for a batch run. See details.
`row.names` | passed to `as.data.frame.data.frame`
`optional` | passed to `as.data.frame.data.frame`
`object` | the object to show

### Details

Valid knob names include: any parameter name (in `param(mod)`), time variables (`start`, `end`, `delta`), PK dosing items (`amt`, `ii`, `rate`, and others ...), and solver settings (`atol`, `hmax`, etc...).

### Value

An object of class `batch_mrgsims`. Most methods for `mrgsims` objects also work on `batch_mrgsims` object.

### Examples

    ## example("knobs")

    mod <- mrgsolve::house(end=72)

    events <- ev(amt=1000, cmt=1, addl=3, ii=12)

    out <- mod %>% ev(events) %>% knobs(CL=c(1,2,3))
    plot(out)

    out

    out <- mod %>% ev(events) %>% knobs(CL=c(1,2,3), VC=c(5,20,50))
    plot(out)
    plot(out,CP~.)
    plot(out, CP~time|VC, groups=CL, lty=2)

    out <- knobs(mod, amt=c(100,300,500), cmt=1)
    plot(out)

    out <- mod %>% knobs(amt=c(100,300), CL=c(1,3), VC=c(5,20), cmt=1)
    plot(out)
    plot(out, CP~.)

    out <- knobs(mod, CL=c(1,2,3))
    out

    out <- knobs(mod, CL=c(1,2,3))
    out

[Package mrgsolve version 1.0.0 Index]