#
# W_E20 Model2
#
#
# Cut-and-Paste Code below into window above and Run
#
# Measurement Matrix # (Growth-XREAL) (Growth-T) (T+XREAL-L) (X-N-L) (Q-N)
# Q N XREAL X L T
#[1,] 0.3934 0.471 -0.232 0.4614 0.4743 0.363
#[2,] 0.5140 0.146 0.742 0.0112 0.0842 -0.395
#[3,] 0.0375 -0.192 0.477 -0.0230 -0.2188 0.828
#[4,] -0.1901 -0.271 0.114 0.8864 -0.2553 -0.16265
#[5,] 0.7043 -0.599 -0.355 -0.0262 -0.1370 -0.00238
#
# Fraction of Variance
#[1] 0.717 0.925 0.982 1.000 1.000 1.000
#
AIC <- function(model) {informationTestsCalculations(model)[3]}
require(dse)
require(matlab)
f <- matrix( c(0.999786547, -0.0240597379, -0.3345180161, 0.207659376, -0.01688057, 0.1078917882,
0.092242828, 1.0758906337, 0.3767707285, -0.090040603, 3.6556120, 0.0792684816,
-0.008180550, 0.0498409889, 0.2846727166, 0.412570476, -0.22675544, -0.0335588961,
-0.011326893, -0.0884080890, 0.1189274920, 0.992370576, 0.56004578, -0.0263901081,
0.000730758, 0.0003718024, 0.0008210908, -0.006695602, 0.89516022, -0.0001696577,
0.000000000, 0.0000000000, 0.0000000000, 0.000000000, 0.00000000, 1.0000000000
),byrow=TRUE,nrow=6,ncol=6)
h <- eye(5,6)
k <- (f[,1:5,drop=FALSE])
WE20 <- SS(F=f,H=h,K=k,z0=c(0.1078917882, 0.0792684816, -0.0335588961, -0.026390108, -0.0001696577, 1.0000000000),
output.names=c("W1","W2","W3","W4","W5"))
print(WE20)
is.SS(WE20)
stability(WE20)
# tfplot(simulate(WE20,sampleT=100))
WE20.data <- simulate(WE20,sampleT=50,noise=matrix(0,50,5))
WE20.f <- forecast(m <- l(WE20,WE20.data),horizon=50)
tfplot(WE20.f,series=1:3)
tfplot(WE20.f,series=4:5)
AIC(m)