Description Usage Arguments Value Examples
Model prediction function from data.frame
1 |
data |
data.frame with columns "name", "time", and row names that are taken as parameter names. The data frame can contain a column "value" to initialize the parameters. |
condition |
either NULL (generic prediction for any condition) or a character, denoting the condition for which the function makes a prediction. |
Object of class prdfn, i.e.
a function x(times pars, deriv = TRUE, conditions = NULL)
,
see also Xs. Attributes are "parameters", the parameter names (row names of
the data frame), and possibly "pouter", a named numeric vector which is generated
from data$value
.
1 2 3 4 5 6 7 8 9 10 11 | # Generate a data.frame and corresponding prediction function
timesD <- seq(0, 2*pi, 0.5)
mydata <- data.frame(name = "A", time = timesD, value = sin(timesD),
row.names = paste0("par", 1:length(timesD)))
x <- Xd(mydata)
# Evaluate the prediction function at different time points
times <- seq(0, 2*pi, 0.01)
pouter <- structure(mydata$value, names = rownames(mydata))
prediction <- x(times, pouter)
plot(prediction)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.