#
# CN_2000 Model
#
# Measurement Matrix
# EN.ATM.CO2E.KT EG.USE.COMM.KT.OE NY.GDP.MKTP.KD SL.TLF.TOTL.IN
#[1,] 0.328 0.325 0.306 0.3306
#[2,] 0.253 0.265 0.425 -0.2289
#[3,] -0.116 -0.236 -0.188 0.0332
# SP.POP.TOTL SL.UEM.TOTL.ZS SP.URB.TOTL EF KOF HDI
#[1,] 0.3311 -0.225 0.3345 0.3342 0.294 0.3371
#[2,] -0.2248 0.698 0.1679 0.1365 -0.189 -0.1116
#[3,] 0.0467 0.494 0.0878 -0.0885 0.792 0.0716
#
# Fraction of Variance
#
AIC <- function(model) {informationTestsCalculations(model)[3]}
require(dse)
require(matlab)
f <- matrix( c(0.92964512, -0.2057941, 0.22660545, 0.03978508,
0.05607191, 1.0690800, -0.07760423, 0.03399751,
0.18197097, 0.4048719, 0.59453473, 0.32399283,
0.00000000, 0.0000000, 0.0000000, 1.0000000000
),byrow=TRUE,nrow=4,ncol=4)
#
# To Stabilize Growth
# f[1,1] <- 0.89301340
# f[2,2] <- 1.0269540
# f[3,3] <- 0.57110769
#
h <- eye(3,4)
k <- (f[,1:3,drop=FALSE])
CN20 <- SS(F=f,H=h,K=k,z0=c(0.03978508, 0.03399751, 0.32399283, 1.0000000000),
output.names=c("CN1","CN2","CN3"))
print(CN20)
is.SS(CN20)
stability(CN20)
# tfplot(simulate(CN20,sampleT=100))
CN20.data <- simulate(CN20,sampleT=100,noise=matrix(0,100,3),start=1960)
CN20.f <- forecast(l(CN20,CN20.data),horizon=100)
tfplot(CN20.f)
AIC(l(CN20,CN20.data))