# Cut-and-paste code below into window above and Run
#
# Northern Europe (NEU_LM_TECH) Model (1950-2000)
#
#
# Measurement Matrix Overall, (X-N-L), (N-L)
# Q N XREAL X L
#[1,] 0.458 0.446 0.452 0.431 0.448
#[2,] -0.104 -0.469 0.335 0.689 -0.428
#[3,] -0.180 0.734 -0.262 0.266 -0.538
# Fraction of Variance
#[1] 0.95 1.00 1.00 1.00 1.00
#
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.0046421227, -0.021958534, 1.0373546, 0.144854912,
0.0312022556, 1.00473308, -2.1137973, 0.003654146,
-0.0001939729, 0.002444952, 0.8655436, 0.000553031,
0.0000000000, 0.000000000, 0.0000000, 1.000000000
),byrow=TRUE,nrow=4,ncol=4)
#
# To Create a Steady State, uncomment Next Line
#
# f[1,1] <- 0.9945957015; f[2,2] <- 0.994685754; f[3,3] <- 0.8568882
#
h <- eye(3,4)
k <- (f[,1:3,drop=FALSE])
NEU_LM <- SS(F=f,H=h,K=k,z0=c( 0.144854912, 0.003654146, 0.000553031, 1.000000000),
output.names=c("NEU_LM1","NEU_LM2","NEU_LM3"))
print(NEU_LM)
is.SS(NEU_LM)
stability(NEU_LM)
#NEU_LM.data <- simulate(NEU_LM,sampleT=100,start=1950)
NEU_LM.data <- simulate(NEU_LM,sampleT=100,noise=matrix(0,100,3),start=1950)
NEU_LM.f <- forecast(l(NEU_LM,NEU_LM.data),horizon=150)
NEU_LM.fx <- merge.forecast(NEU_LM.f)
tfplot(NEU_LM.f)
AIC(m <- l(NEU_LM,NEU_LM.data))
NEU_LMx <- SS(F=f,H=h,Q=eye(4,3),R=eye(3,3),z0=c( 0.144854912, 0.003654146, 0.000553031, 1.0000000000),
output.names=c("NEU_LM1","NEU_LM2","NEU_LM3"))
shockDecomposition(NEU_LMx)
AIC(m <- l(NEU_LM,NEU_LM.data))