Description Usage Arguments Details Value See Also Examples
Fit the parameters (and optionally initial states) for an Ordinary Differential Equation model with data sampled across contexts. Two implementations exist:
rodeo.ode
The raw form of rodeo, based on ode
(created via mak
, plk
, etc.) and opt
-objects. If needed, everything can be user-specified through these two objects. However, parameter initialisations are always required and no action towards adjusting weights or scales of the parameters are taken.
rodeo.aim
The more automatic form of rodeo, where automatic parameter initialisations and (optional) adjustments of scales and weights are available through aim
.
1 |
x |
Object that specifies ode system. |
... |
Additional arguments passed to |
For details on the loss function, optimisation, etc. See documentation of opt
.
An object with S3 class "rodeo":
o |
Original |
op |
Original |
params |
Parameter estimates, stored as list of sparse column format matrices, "dgCMatrix" (or a list of those if multiple initialisations). Rows represent coordinates and columns represent the |
x0s |
Initial state estimates stored in a matrix (or array). Rows represent coordinates, columns represent the |
dfs |
A matrix (or array, if multiple initialisations) of degrees of freedom. Row represents a parameter (the first is always the initial state parameter), columns represent lambda, slices represent initialisation, if multiple are provided. |
codes |
A matrix (or array) of convergence codes organised as
|
steps |
A matrix (or array) holding number of steps used in optimisation procedure. Organised as |
losses |
A vector (or matrix) of unpenalised losses at optimum for each lambda value (stored row-wise if multiple are provided). |
penalties |
A matrix (or array) of penalties for each parameter, organised as |
jerr |
A matrix (or array) of summary codes (for internal debugging), organised as |
rodeo.aim, rodeo.ode
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 | set.seed(123)
# Michaelis-Menten system with two 0-rate reactions
A <- matrix(c(1, 1, 0, 0,
0, 0, 1, 0,
0, 0, 1, 0,
0, 0, 0, 1,
1, 0, 0, 0), ncol = 4, byrow = TRUE)
B <- matrix(c(0, 0, 1, 0,
1, 1, 0, 0,
1, 0, 0, 1,
0, 0, 1, 0,
1, 0, 1, 0), ncol = 4, byrow = TRUE)
k <- c(1.1, 2.5, 0.25, 0, 0); x0 <- c(E = 2, S = 2, ES = 8.5, P = 2.5)
Time <- seq(0, 10, by = 1)
# Simulate data, in second context the catalytic rate has been doubled
contexts <- cbind(1, c(1, 1, 2, 1, 1))
m <- mak(A, B, r = reg(contexts = contexts))
y <- numsolve(m, c(Time, Time), cbind(x0, x0 + c(2, -2, 0, 0)), contexts * k)
y[, -1] <- y[, -1] + matrix(rnorm(prod(dim(y[, -1])), sd = .5), nrow = nrow(y))
# Example: fit data using rodeo on mak-object
op <- opt(y, nlambda = 10)
fit <- rodeo(m, op, x0 = NULL, params = NULL)
fit$params$rate
# Example: fit dat using rodeo on aim-object
a <- aim(m, op)
a$params$rate
fit <- rodeo(a)
fit$params$rate
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.