#
# CH_LM Model (Switzerland)
#
AIC <- function(model) {informationTestsCalculations(model)[3]}
require(dse)
require(matlab)
#
# MEASUREMENT MATRIX
#
# Q N U HOURS XREAL X L
#[1,] 0.389 0.388 0.388 0.354 0.387 0.345 0.3906
#[2,] -0.145 -0.199 0.180 -0.618 0.210 0.687 -0.0917
#[3,] 0.212 0.275 0.547 -0.566 -0.224 -0.446 0.1031
#
#
# Fraction of Variance
#[1] 0.933 1.000 1.000 1.000 1.000 1.000 1.000
#
f <- matrix( c(
0.986091451, -0.02842443, 0.4585358, 0.165226628,
0.034833406, 1.02993562, -0.5527579, 0.014032953,
-0.001291216, 0.01073976, 0.8885394, 0.003541658,
0.000000000, 0.00000000, 0.0000000, 1.000000000
),byrow=TRUE,nrow=4,ncol=4)
#
# To Stabilize System Uncomment Next Line
# f[1,1] <- 0.976230536; f[2,2] <- 1.01963627; f[3,3] <- 0.8796540
#
h <- eye(3,4)
k <- (f[,1:3,drop=FALSE])
CH_LM <- SS(F=f,H=h,K=k,z0=c(0.329380291, 0.032283718, 0.006625928, 1.0000000000),
output.names=c("CH1","CH2","CH3"))
print(CH_LM)
is.SS(CH_LM)
stability(CH_LM)
# tfplot(simulate(CH_LM,sampleT=100,start=1950))
CH_LM.data <- simulate(CH_LM,sampleT=100,noise=matrix(0,100,3),start=1950)
CH_LM.f <- forecast(m <- l(CH_LM,CH_LM.data),horizon=100)
tfplot(CH_LM.f)
AIC(m)
shockDecomposition(toSSChol(CH_LM))