#
# DELMA World Model Late Middle Ages (1300-1450)
# Cut and Paste code below and Run
#
# Measurement Matrix (Growth), (Q-N-U), (U-N)
# Q N U
#[1,] 0.542 0.600 0.589
#[2,] 0.834 -0.299 -0.463
#[3,] 0.102 -0.742 0.663
#
# Fraction of Variance
#[1] 0.9 1.0 1.0
#
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(0.9921923485, 0.014907742, 0.07944167, 0.0551914372,
-0.0165342314 , 1.027646262, 0.13851520, -0.0052591052,
-0.0001066824, -0.002558995, 0.98016139, 0.0004458645,
0.00000000, 0.0000000, 0.0000000, 1.0000000000
),byrow=TRUE,nrow=4,ncol=4)
h <- eye(3,4)
k <- (f[,1:3,drop=FALSE])
DELMA <- SS(F=f,H=h,K=k,z0=c( 0.0551914372, -0.0052591052, 0.0004458645, 1.0000000000),
output.names=c("DE1","DE2","DE3"))
print(DELMA)
is.SS(DELMA)
stability(DELMA)
# tfplot(simulate(DELMA,sampleT=150))
#DELMA.data <- simulate(DELMA,sampleT=150,noise=matrix(0,150,3))
DELMA.data <- simulate(DELMA,sampleT=150)
DELMA.f <- forecast(l(DELMA,DELMA.data),horizon=150)
tfplot(DELMA.f)
AIC(m <- l(DELMA,DELMA.data))
shockDecomposition(toSSChol(m))