#
# World WM_456
#
require(dse)
require(matlab)
# Measurement Matrix
# Q N XREAL X L T
#[4,] 0.106 0.0711 0.6872 -0.6537 -0.286 -0.0471
#[5,] 0.709 -0.6838 -0.0761 -0.0871 0.118 -0.0431
#[6,] 0.491 0.4743 -0.4344 -0.0662 -0.574 -0.1091
#
#Fraction of Variance
#[1] 0.787 0.961 0.996 0.999 1.000 1.000
#
#
merge.forecast <- function (fx,n=1) {
x <- splice(fx$pred,fx$forecast[[n]])
colnames(x) <- seriesNames(fx$data$output)
return(x)
}
AIC <- function(model) {informationTestsCalculations(model)[3]}
f <- matrix( c( 0, 0, 0, -1.05880434, 0.07451654, 0.471272975, 0.0000000000,
0, 0, 0, 0.01695382, -0.98864519, 0.409946802, 0.0000000000,
0, 0, 0, 0.03990796, 0.12436834, 0.007157975, 0.0000000000,
1, 0, 0, 2.03906915, -0.05684720, -0.602899002, 0.0002207346,
0 , 1, 0, -0.01440357, 1.97968639, -0.559850839, -0.0001636129,
0 , 0 , 1, -0.03727959, -0.13038914, 0.620596619, -0.0001237903,
0 , 0 , 0, 0.00000000, 0.00000000, 0.000000000, 1.0000000000
),byrow=TRUE,nrow=7,ncol=7)
h <- matrix(c( 0, 0, 0, 1, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0,
0, 0, 0, 0, 0, 1, 0
),byrow=TRUE,nrow=3,ncol=7)
k <- f[1:7,4:6,drop=FALSE]
W456 <- SS(F=f,H=h,K=k,z0=c( 0.0000000000, 0.0000000000, 0.0000000000, 0.0002207346, -0.0001636129, -0.0001237903,1),
output.names=c("WM4","WM5","WM6"))
W456
stability(W456)
shockDecomposition(toSSChol(W456))
#tfplot(simulate(W456,sampleT=50,noise=matrix(0,50,3),start=1))
W456.data <- simulate(W456,sampleT=50,start=1)
m <- l(W456,W456.data)
#tfplot(m)
W456.f <- forecast(m,horizon=50)
tfplot(W456.f)
AIC(m)