Description Usage Arguments Details Value Note Author(s) References See Also Examples
ODEmorris.default
is the default method of ODEmorris
. It
performs a sensitivity analysis for general ODE models using the Morris
screening method.
1 2 3 4 5 |
mod |
[ |
pars |
[ |
state_init |
[ |
times |
[ |
binf |
[ |
bsup |
[ |
r |
[ |
design |
[ |
scale |
[ |
ode_method |
[ |
parallel_eval |
[ |
parallel_eval_ncores |
[ |
... |
further arguments passed to or from other methods. |
Function ode
from deSolve
is
used to solve the ODE system.
The sensitivity analysis is done for all state variables and all
timepoints simultaneously using morris
from the
package sensitivity
.
For non-ODE models, values for r
are typically between 10 and 50.
However, much higher values are recommended for ODE models (the default is
r = 500
).
List of class ODEmorris
of length length(state_init)
containing in each element a matrix for one state variable. The
matrices themselves contain the Morris screening results for all timepoints
(rows: mu, mu.star
and sigma
for every parameter; columns:
timepoints).
If the evaluation of the model function takes too long, it might be helpful
to try another ODE-solver (argument ode_method
). The
ode_method
s "vode"
, "bdf"
, "bdf_d"
,
"adams"
, "impAdams"
and "impAdams_d"
might be faster
than the default "lsoda"
.
If morris
throws a warning message stating
"In ... keeping ... repetitions out of ...", try using a bigger number of
levels
in the design
argument (only possible for OAT design).
Stefan Theers, Frank Weber
J. O. Ramsay, G. Hooker, D. Campbell and J. Cao, 2007, Parameter estimation for differential equations: a generalized smoothing approach, Journal of the Royal Statistical Society, Series B, 69, Part 5, 741–796.
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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | ##### Lotka-Volterra equations #####
# The model function:
LVmod <- function(Time, State, Pars) {
with(as.list(c(State, Pars)), {
Ingestion <- rIng * Prey * Predator
GrowthPrey <- rGrow * Prey * (1 - Prey/K)
MortPredator <- rMort * Predator
dPrey <- GrowthPrey - Ingestion
dPredator <- Ingestion * assEff - MortPredator
return(list(c(dPrey, dPredator)))
})
}
# The parameters to be included in the sensitivity analysis and their lower
# and upper boundaries:
LVpars <- c("rIng", "rGrow", "rMort", "assEff", "K")
LVbinf <- c(0.05, 0.05, 0.05, 0.05, 1)
LVbsup <- c(1.00, 3.00, 0.95, 0.95, 20)
# The initial values of the state variables:
LVinit <- c(Prey = 1, Predator = 2)
# The timepoints of interest:
LVtimes <- c(0.01, seq(1, 50, by = 1))
# Morris screening:
set.seed(7292)
# Warning: The following code might take very long!
LVres_morris <- ODEmorris(mod = LVmod,
pars = LVpars,
state_init = LVinit,
times = LVtimes,
binf = LVbinf,
bsup = LVbsup,
r = 500,
design = list(type = "oat",
levels = 10, grid.jump = 1),
scale = TRUE,
ode_method = "lsoda",
parallel_eval = TRUE,
parallel_eval_ncores = 2)
##### FitzHugh-Nagumo equations (Ramsay et al., 2007) #####
FHNmod <- function(Time, State, Pars) {
with(as.list(c(State, Pars)), {
dVoltage <- s * (Voltage - Voltage^3 / 3 + Current)
dCurrent <- - 1 / s *(Voltage - a + b * Current)
return(list(c(dVoltage, dCurrent)))
})
}
# Warning: The following code might take very long!
FHNres_morris <- ODEmorris(mod = FHNmod,
pars = c("a", "b", "s"),
state_init = c(Voltage = -1, Current = 1),
times = seq(0.1, 50, by = 5),
binf = c(0.18, 0.18, 2.8),
bsup = c(0.22, 0.22, 3.2),
r = 500,
design = list(type = "oat",
levels = 50, grid.jump = 1),
scale = TRUE,
ode_method = "adams",
parallel_eval = TRUE,
parallel_eval_ncores = 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.