Skip to contents

Function to estimate interaction strengths using LIM.

Usage

fw_infer(x, eff_max = 1, ...)

fw_predict_A(y, index = 1)

fw_predict_B(y, index = 1)

Arguments

x

an object of class fw_problem.

eff_max

max efficiency.

...

further arguments passed to limSolve::xsample()).

y

an object of class fw_predicted

index

index of the prediction to be used.

Value

Return a list of two elements:

  • prediction: a data frame with one column per interaction strength estimated. The number of row is given by the number of interaction sets estimated by xsample() (see parameter iter in xsample()).

Details

LIM based on generalized linear Lotka-Volterra model with the following interaction matrix: $$\frac{1/X}{X'} = A * X + R $$ See limSolve::xsample() for the meaning of matrices E, F, G and H.

Functions

  • fw_predict_A(): returns predicted A.

  • fw_predict_B(): returns predicted B.

References

  • Gellner G, McCann K, Hastings A. 2023. Stable diverse food webs become more common when interactions are more biologically constrained. Proceedings of the National Academy of Sciences 120:e2212061120. DOI: 10.1073/pnas.2212061120.

Examples

A <- rbind(c(-1, -1), c(1, 0))
R <- c(0.1, -0.05)
B <- c(0.5, 0.25)
res <- fw_problem(A, B, R) |> fw_infer()
#> Warning: No equalities - setting type = 2