Description Usage Arguments Details Value
View source: R/cross_validate.R
Performs cross validation using the method of Stein et al., "Ecological Moldeing from Time Series Infernece: Insight into Dynamics and Stability of Intestinal Microbiota; PLoS Comp Bio 2013.
1 | cross_validate(data, k = 3, time_step = NULL, reduced = TRUE, lambda = 0)
|
data |
A data frame of logistic growth time series data, one column should be named "t" and one should be named "P". |
k |
Numeric; the number of partitions for k-fold cross validation. defaults to 3 in accordance with Stein et al's recommendation. |
time_step |
Numeric; also strictly positive. Can be inputted manually but defaults to the maximum time value divided by the number of time points used. |
reduced |
Logical; if TRUE, the carrying capacity is assumed to be 1 and only r is fitted in the model. If FALSE, both K and r are fitted. |
lambda |
Numeric; strictly positive. The smoothing parameter to use for Tikhonov regularization in the regression model. Defaults to zero. |
Stein et al. recommended performing 3-fold cross validation 10 times. This should be accomplished fairly easily with the 'replicate' command.
The cross-validation error for k-fold cross validation on the model.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.