#
# EAP BAU Model (Growth) , (E-LU-N-L), (LU+E-Q-N-L)
#
# Measurement Matrix
# EN.ATM.CO2E.KT EG.USE.COMM.KT.OE NY.GDP.MKTP.KD SL.TLF.TOTL.IN
#[1,] 0.4173 0.387 0.421 0.416
#[2,] 0.2833 0.690 0.107 -0.257
#[3,] -0.0241 0.348 -0.249 -0.403
# SP.POP.TOTL SL.UEM.TOTL.ZS
#[1,] 0.416 0.391
#[2,] -0.266 -0.544
#[3,] -0.337 0.735
#
#Fraction of Variance
#[1] 0.929 0.983 0.999 0.999 1.000 1.000
#
AIC <- function(model) {informationTestsCalculations(model)[3]}
require(dse)
require(matlab)
f <- matrix( c( 1.013525735, 0.01188695, -0.04778997, 0.163454014,
0.043107685, 1.05369816, 0.11454522, 0.020783915,
-0.001597011, 0.02340716, 0.88382763, 0.003595889,
0.00000000, 0.0000000, 0.0000000, 1.0000000000
),byrow=TRUE,nrow=4,ncol=4)
#
# To Stabilize the model, uncomment the next line
# f[1,1] <- f[2,2] <- 0.9
#
h <- eye(3,4)
k <- (f[,1:3,drop=FALSE])
EAP20 <- SS(F=f,H=h,K=k,z0=c(0.163454014, 0.020783915, 0.003595889, 1.0000000000),
output.names=c("EAP1","EAP2","EAP3"))
print(EAP20)
is.SS(EAP20)
stability(SS(F=f[1:3,1:3,drop=FALSE],Q=eye(3),H=eye(3),R=eye(3)))
# tfplot(simulate(EAP20,sampleT=100))
EAP20.data <- simulate(EAP20,sampleT=100,noise=matrix(0,100,3),start=1960)
EAP20.f <- forecast(l(EAP20,EAP20.data),horizon=100)
tfplot(EAP20.f)
AIC(l(EAP20,EAP20.data))