# Cut-and-paste code below into the window above and Run
#
# EE_RE Eastern Europe Model Roman Empire (RE 0-500)
#
# Measurement Matrix
# Q N
#[1,] 0.707 0.707
#[2,] 0.707 -0.707
#
# Fraction of Variance
#[1] 0.999 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( 0.9990356120, 0.008790961, 0.0095770669,
-0.0005332231, 1.004860640, -0.0001137029,
0.000000000, 0.00000000, 1.0000000000)
,byrow=TRUE,nrow=3,ncol=3)
h <- eye(2,3)
k <- (f[,1:2,drop=FALSE])
EE_RE <- SS(F=f,H=h,K=k,z0=c(0.0095770669, -0.0001137029, 1.0000000000),
output.names=c("EE1","EE2"))
print(EE_RE)
is.SS(EE_RE)
stability(EE_RE)
tfplot(EE_RE.data <- simulate(EE_RE,sampleT=150,start=0))
#EE_RE.data <- simulate(EE_RE,sampleT=20,noise=matrix(0,20,2))
EE_RE.f <- forecast(m <- l(EE_RE,EE_RE.data),horizon=150)
tfplot(EE_RE.f)
AIC(m)
shockDecomposition(toSSChol(m))