ridge_fit | R Documentation |
When determining the Lotka-Volterra coefficients of an OTU system, this function solves the linear equations using ridge regularization (l^2).
ridge_fit(equations, weights)
equations |
Equations returned from integralSystem |
weights |
Named numeric, a vector with two entries. The first one is named |
The equations are fitted individually, this is: For each OTU, all coefficients determining it abundance is fitted independently from the other coeffcients. The entity
\| Aβ-b \|^2+λ_{\mathrm{self}}β_{\mathrm{self}}^2+ λ_{\mathrm{interaction}}\|β_{\mathrm{interaction}}\|^2
will be minimized where β is the estimated solution, β_{\mathrm{self}} is the estimated maximal growth rate of the OTU and β_{\mathrm{inteaction}} are the estimated effect of the interactions with the other OTUs (and itself).
An n_OTU times (n_OTU+1) numeric matrix where each row contains the coefficients determining
the growth of the selected OTU. The first column contains the estimated growth rates, while the other
rows contain the estimates for the interaction coefficients. This object has
the S3 class attribute LV
.
Richard R. Stein et al. “Ecological Modeling from Time-Series Inference: Insight into Dy- namics and Stability of Intestinal Microbiota.” In: PLoS Comput. Biol. 9.12 (desember 2013). issn: 1553-7358. DOI: https://doi.org/10.1371/journal.pcbi.1003388.
integralSystem
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 <- ridge_fit(systems,weights = c(self = 10,interaction = 1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.