#
# WE_RE Western Europe Model Roman Empire (RE) RW
#
#Measurement Matrix
# Q N
#[1,] 0.707 -0.707
#[2,] 0.707 0.707
#
# Fraction of Variance
#[1] 0.989 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 <- eye(3)
h <- eye(3)
q <- eye(3)
r <- eye(3)
WE <- SS(F=f,H=h,Q=q,R=r,z0=c(-0.7954634, 0.2594429, 0.1396850),
output.names=c("WE1","WE2","WE3"))
print(WE)
is.SS(WE)
stability(WE)
tfplot(WE.data <- simulate(WE,sampleT=150,start=0))
#WE.data <- simulate(WE,sampleT=20,noise=matrix(0,20,3))
WE.f <- forecast(m <- l(WE,WE.data),horizon=50)
tfplot(WE.f)
AIC(m)
shockDecomposition(toSSChol(m))