lm_svd: SVD solution to the Linear Least Squares Problem

Description Usage Arguments Value References Examples

Description

Solution to the linear least squares problem using Singular Value Decomposition (SVD).

Usage

1
lm_svd(y, x, weights, intercept = TRUE)

Arguments

y

Target time series at time t+1.

x

Time series at time t.

weights

Weights for the exponentially-weighted linear model.

Value

Values in the Jacobian.

References

Deyle, E. R., May, R. M., Munch, S. B., & Sugihara, G. (2016, January). Tracking and forecasting ecosystem interactions in real time. In Proc. R. Soc. B (Vol. 283, No. 1822, p. 20152258). The Royal Society.

Examples

1
2
3
4
5
x <- matrix(sample(1:10, size = 30, replace = TRUE), nrow = 10, ncol = 3)
y <- 2*x[,1] + 0.25*x[,2] + rnorm(n = 10, mean = 0, sd = 1)
weights <- apply(x, MARGIN = 1, FUN = var)

lm_svd(y, x, weights)

langendorfr/DMMS documentation built on May 14, 2019, 2:55 p.m.