Description Usage Arguments Details Value See Also Examples
Fit the parameters for an ODE model with data sampled across different contexts.
1 2 |
x |
|
adjusts |
Character vector holding names of what quantities to adjust during algorithm. Possible quantities are: |
trace |
Logical indicating if status messages should be printed during |
... |
Additional arguments passed to |
The adapted quantities (scales
, weights
, penalty_factor
) of x
(returned by aim
) are fed to the exact estimator rodeo
. This estimator then traverses the lambda
sequence in reverse order initialised in the last estimates from aim
.
If desired, the quantities lambda
, scales
and weights
are adjusted as in aim
.
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 32 33 34 35 36 37 38 39 40 | set.seed(123)
# Example: Power Law Kinetics
A <- matrix(c(1, 0, 1,
1, 1, 0), byrow = TRUE, nrow = 2)
p <- plk(A)
x0 <- c(10, 4, 1)
theta <- matrix(c(0, -0.25,
0.75, 0,
0, -0.1), byrow = TRUE, nrow = 3)
Time <- seq(0, 1, by = .025)
# Simulate data
y <- numsolve(p, Time, x0, theta)
y[, -1] <- y[, -1] + matrix(rnorm(prod(dim(y[, -1])), sd = .25), nrow = nrow(y))
# Estimation via aim
a <- aim(p, opt(y, nlambda = 10))
a$params$theta
# Supply to rodeo
rod <- rodeo(a)
rod$params$theta
# Compare with true parameter on column vector form
matrix(theta, ncol = 1)
# Example: include data from an intervened system
# where the first complex in A is inhibited
contexts <- cbind(1, c(0, 0, 0, 1, 1, 1))
y2 <- numsolve(p, Time, x0 + 1, theta * contexts[, 2])
y2[, -1] <- y2[, -1] + matrix(rnorm(prod(dim(y2[, -1])), sd = .25), nrow = nrow(y2))
# Estimation via aim
a <- aim(plk(A, r = reg(contexts = contexts)), opt(rbind(y, y2), nlambda = 10))
a$params$theta
# Supply to rodeo
rod <- rodeo(a)
rod$params$theta
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.