
The function creates a dlm representation of a linear regression model.
dlmModReg(X, addInt = TRUE, dV = 1, dW = rep(0, NCOL(X) + addInt),
m0 = rep(0, length(dW)),
C0 = 1e+07 * diag(nrow = length(dW)))
An object of class dlm representing the specified regression model.
the design matrix
logical: should an intercept be added?
variance of the observation noise.
diagonal elements of the variance matrix of the system noise.
Giovanni Petris GPetris@uark.edu
By setting dW
equal to a nonzero vector one obtains a DLM
representation of a dynamic regression model. The default value zero
of dW
corresponds to standard linear regression. Only
univariate regression is currently covered.
Giovanni Petris (2010), An R Package for Dynamic Linear
Models. Journal of Statistical Software, 36(12), 1-16.
https://www.jstatsoft.org/v36/i12/.
Petris, Petrone, and Campagnoli, Dynamic Linear Models with
R, Springer (2009).
West and Harrison, Bayesian forecasting and dynamic models
(2nd ed.), Springer, 1997.
dlmModARMA
, dlmModPoly
,
dlmModSeas
x <- matrix(runif(6,4,10), nc = 2); x
dlmModReg(x)
dlmModReg(x, addInt = FALSE)
Run the code above in your browser using DataLab