#
# VEL20 BAU Model
#
AIC <- function(model) {informationTestsCalculations(model)[3]}
require(dse)
require(matlab)
# Measurement Matrix Growth, (LU-GDP), (EF+HDI-CO2-E)
# EN.ATM.CO2E.KT EG.USE.COMM.KT.OE SL.TLF.TOTL.IN SP.POP.TOTL
#[1,] 0.3356 0.3346 0.3476 0.3495
#[2,] 0.0463 0.0144 -0.1485 -0.0859
#[3,] -0.4995 -0.3229 -0.0869 -0.0911
# SL.UEM.TOTL.ZS NY.GDP.MKTP.KD KOF EF HDI
#[1,] 0.297 0.331 0.332 0.333 0.337
#[2,] 0.791 -0.479 0.141 0.106 -0.287
#[3,] 0.182 0.114 -0.259 0.608 0.384
#
# Fraction of Variance
#[1] 0.902 0.951 0.976 0.989 0.996 0.999 0.999 1.000 1.000
#
f <- matrix( c(0.999861788, -0.015893040, 0.08759642, 0.168215354,
-0.007373528, 0.919408815, 0.11661879, -0.036413151,
-0.008284316, -0.004304076, 0.92326951, 0.002922896,
0.00000000, 0.0000000, 0.0000000, 1.0000000000
),byrow=TRUE,nrow=4,ncol=4)
h <- eye(3,4)
k <- (f[,1:3,drop=FALSE])
VEL20 <- SS(F=f,H=h,K=k,z0=c(0.168215354, -0.036413151, 0.002922896, 1.0000000000),
output.names=c("VE1","VE2","VE3"))
print(VEL20)
is.SS(VEL20)
stability(m0 <- SS(F=f[1:3,1:3,drop=FALSE],H=eye(3),Q=eye(3),R=eye(3),output.names=c("VE1","VE2","VE3")))
# tfplot(simulate(VEL20,sampleT=150))
VEL20.data <- simulate(VEL20,sampleT=150,noise=matrix(0,150,3),start=1960)
VEL20.f <- forecast(m <- l(VEL20,VEL20.data),horizon=150)
tfplot(VEL20.f)
AIC(m)
#
# Negative Shock (change shock=1 for positive)
#
shockDecomposition(m0,shock=-1)