# Cut-and-Paste Code Below into Window Above an Run
#
# WE_E20 Model
#
# Measurement Matrix (overall-HOURS-XREAL), (XREAL-X), (Q-N-L-U)
#
# Q N U HOURS XREAL X L
#[1,] 0.231 0.418 0.422 -0.4280 -0.3203 0.4024 0.382
#[2,] 0.297 0.248 0.180 0.0687 0.6937 -0.3924 0.422
#[3,] 0.909 -0.186 -0.217 -0.0863 -0.0981 -0.0114 -0.274
#
#Fraction of Variance
#[1] 0.748 0.883 0.993 1.000 1.000 1.000 1.000
#
AIC <- function(model) {informationTestsCalculations(model)[3]}
require(dse)
require(matlab)
f <- matrix( c(1.00629959, -0.05766949, -0.09542032, 0.12654495,
0.04296649, 1.06699880, 0.27025187, 0.10806276,
0.05938140, -0.01188805, 1.04875201, 0.02649331,
0.00000000, 0.0000000, 0.0000000, 1.0000000000
),byrow=TRUE,nrow=4,ncol=4)
#
# To create RWf model, uncomment following line
# f[1,1] <- f[2,2] <- f[3,3] <- 1.0
#
h <- eye(3,4)
k <- (f[,1:3,drop=FALSE])
WE_E20 <- SS(F=f,H=h,K=k,z0=c( 0.12654495, 0.10806276, 0.02649331, 1.0000000000),
output.names=c("WE1","WE2","WE3"))
print(WE_E20)
is.SS(WE_E20)
stability(WE_E20)
WE_E20.data <- simulate(WE_E20,sampleT=150,start=1900)
# WE_E20.data <- simulate(WE_E20,sampleT=20,noise=matrix(0,20,3))
WE_E20.f <- forecast(l(WE_E20,WE_E20.data),horizon=50)
tfplot(WE_E20.f)
AIC(l(WE_E20,WE_E20.data))
shockDecomposition(toSSChol(WE_E20),horizon=10,shock=rep(-1,10))