# dlmModPoly: Create an n-th order polynomial DLM In dlm: Bayesian and Likelihood Analysis of Dynamic Linear Models

## Description

The function creates an n-th order polynomial DLM.

## Usage

 1 2 dlmModPoly(order = 2, dV = 1, dW = c(rep(0, order - 1), 1), m0 = rep(0, order), C0 = 1e+07 * diag(nrow = order))

## Arguments

 order order of the polynomial model. The default corresponds to a stochastic linear trend. dV variance of the observation noise. dW diagonal elements of the variance matrix of the system noise. m0 m0, the expected value of the pre-sample state vector. C0 C0, the variance matrix of the pre-sample state vector.

## Value

An object of class dlm representing the required n-th order polynomial model.

## Author(s)

Giovanni Petris [email protected]

## References

Giovanni Petris (2010), An R Package for Dynamic Linear Models. Journal of Statistical Software, 36(12), 1-16. http://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.

## Examples

 1 2 3 4 ## the default dlmModPoly() ## random walk plus noise dlmModPoly(1, dV = .3, dW = .01)

### Example output

\$FF
[,1] [,2]
[1,]    1    0

\$V
[,1]
[1,]    1

\$GG
[,1] [,2]
[1,]    1    1
[2,]    0    1

\$W
[,1] [,2]
[1,]    0    0
[2,]    0    1

\$m0
[1] 0 0

\$C0
[,1]  [,2]
[1,] 1e+07 0e+00
[2,] 0e+00 1e+07

\$FF
[,1]
[1,]    1

\$V
[,1]
[1,]  0.3

\$GG
[,1]
[1,]    1

\$W
[,1]
[1,] 0.01

\$m0
[1] 0

\$C0
[,1]
[1,] 1e+07

dlm documentation built on June 14, 2018, 1:03 a.m.