predict.LV | R Documentation |
This function utilizes the deSolve
package in order to
simulate a Lotka-Volterra system with fitted coefficients. Hence, it can be used
for predictions.
## S3 method for class 'LV' predict(object, start, times, ...)
object |
An object of class |
start |
The vector of the microbial community at the start
of the simulation. The OTUs must be in the same order as in the
|
times |
The time points to include in the simulation |
... |
Additional parameters to the function |
By default, the lsoda
is the method used, but this can be changed by passing an method
argument
An object of type OTU_time_series
, where the
table is a matrix of type deSolve
ridge_fit, deSolve-package
library(micInt) library(phyloseq) data("seawater") subsetted_seawater <- subset_samples(seawater, Reactor == 2) systems <- integralSystem(OTU_time_series(subsetted_seawater,"Week"), kind = "log_integral") fit_1 <- ridge_fit(systems,weights = c(self = 10,interaction = 1)) fit_2 <- ridge_fit(systems,weights = c(self = 1,interaction = 1)) prediction_1 <- predict(fit_1,start = rep(1,nrow(fit_1)),times = c(1,2,3,4,5)) prediction_2 <- predict(fit_2,start = rep(1,nrow(fit_2)),times = c(1,2,3,4,5)) plot_trajectory(list(fit_1=prediction_1,fit_2 =prediction_2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.