#
# WLMA World Model Late Middle Ages (1300-1450)
# Cut and Paste code below into window above and Run
#
# Measurement Matrix
# Q N T
#[1,] 0.577 0.579 -0.576
#[2,] 0.648 0.105 0.755
#[3,] 0.498 -0.808 -0.314
#
#Fraction of Variance
# 0.994 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]}
require(dse)
require(matlab)
f <- matrix( c(1.004773e+00, -2.590120e-03, -7.0154413, 3.965320e-02,
3.365493e-03, 9.981738e-01, -4.9464769, -2.619740e-05,
1.079369e-08, 1.740499e-06, 0.9970529, 8.863475e-08,
0.00000000, 0.0000000, 0.0000000, 1.0000000000
),byrow=TRUE,nrow=4,ncol=4)
h <- eye(3,4)
k <- (f[,1:3,drop=FALSE])
WLMA <- SS(F=f,H=h,K=k,z0=c( 3.965320e-02, -2.619740e-05, 8.863475e-08, 1.0000000000),
output.names=c("W1","W2","W3"))
print(WLMA)
is.SS(WLMA)
stability(WLMA)
# tfplot(simulate(WLMA,sampleT=150))
#WLMA.data <- simulate(WLMA,sampleT=150,noise=matrix(0,150,3),start=1300)
WLMA.data <- simulate(WLMA,sampleT=150,start=1300)
WLMA.f <- forecast(l(WLMA,WLMA.data),horizon=150)
tfplot(WLMA.f)
AIC(m <- l(WLMA,WLMA.data))
shockDecomposition(toSSChol(m))