# Cut-and-Paste Code below into Window above and Run
#
# JPL20 BAU Model
#
AIC <- function(model) {informationTestsCalculations(model)[3]}
require(dse)
require(matlab)
#
#
# Measurement Matrix (Growth) (EF-LU) (LU+EF - CO2 - EG- KOF)
#
# EN.ATM.CO2E.KT EG.USE.COMM.KT.OE NY.GDP.MKTP.KD SL.TLF.TOTL.IN SP.POP.TOTL SL.UEM.TOTL.ZS KOF
#[1,] 0.3346 0.34263 0.34055 0.33936 0.3403 0.3173 0.33505
#[2,] 0.1460 -0.03252 -0.07613 -0.16723 -0.1455 -0.5038 0.09096
#[3,] -0.4833 -0.21377 0.08602 -0.02948 -0.1881 0.5707 -0.32387
# EF HDI
#[1,] 0.3072 0.34113
#[2,] 0.8095 -0.07269
#[3,] 0.4560 0.19650
#
# Fraction of Variance
#[1] 0.9320 0.9607 0.9813 0.9935 0.9966 0.9988 0.9997 0.9999 1.0000
#
f <- matrix( c(1.00000000, 0.00000000, 0.000000000, 0.00000000,
0.18623859, 0.97528236, -0.005253912, -0.07683126,
0.04443008, 0.01742142, 1.079552268, 0.23686051,
0.01000530, 0.02087946, 0.042321721, 0.95754033
),byrow=TRUE,nrow=4,ncol=4)
#
# To stabilize the model, uncomment next line
# f[3,3] <- 0.95
#
h <- matrix(c(0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1
),byrow=TRUE,nrow=3,ncol=4)
k <- matrix(c(0.000000000, 0.00000000, 0.00000000,
0.975282363, 0.01742142, 0.02087946,
-0.005253912, 1.07955227, 0.04232172,
-0.076831255, 0.23686051, 0.95754033
),byrow=TRUE,nrow=4,ncol=3)
JPL20 <- SS(F=f,H=h,K=k,z0=c( 1.00000000, -5.68956448, -0.08221832, 0.66882086),
output.names=c("JP1","JP2","JP3"))
print(JPL20)
is.SS(JPL20)
stability(JPL20)
# tfplot(simulate(JPL20,sampleT=50))
JPL20.data <- simulate(JPL20,sampleT=50,noise=matrix(0,50,3))
JPL20.f <- forecast(l(JPL20,JPL20.data),horizon=50)
tfplot(JPL20.f)
AIC(m <- l(JPL20,JPL20.data))
shockDecomposition(m)