Learn R Programming

mistat (version 2.0.4)

dlmLg: Dynamic Linear Model with linear growth

Description

Dynamic Linear Model with linear growth.

Usage

dlmLg(x, C0, v, W, M0)

Value

a vector with values from the Dynamic Linear Model.

Arguments

x

a vector of data X_t.

C0

prior covariance matrix

v

prior variance of V.

W

prior variance of W.

M0

prior mean.

Author

Shelemyahu Zacks

Examples

Run this code
C0 <- matrix(c(0.22325, -0.00668, -0.00668, 0.00032), nrow = 2, byrow = TRUE)
W <- matrix(c(0.3191, -0.0095, -0.0095, 0.0004), nrow = 2, byrow = TRUE)
M0 <- matrix(c(134.234, -0.3115), nrow = 2)
v <- 0.1

data(DOW1941)
plot(DOW1941$Date, DOW1941$DOW1941,          
     type="l", 
     ylab="Dow Jones 1941", xlab="Date")
     
lines(DOW1941$Date, dlmLg(DOW1941$DOW1941, C0 = C0, v = v, W = W, M0 = M0))


Run the code above in your browser using DataLab