#
# Cut-and-paste code below into Window above and Run
#
# ES1 SYS Model
#
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)
#
# Measurement Matrix (Growth), (LU-EF), (EF+LU-EG-GDP)
# EN.ATM.CO2E.KT EG.USE.COMM.KT.OE NY.GDP.MKTP.KD SL.TLF.TOTL.IN
#[1,] 0.3527 0.3500 0.3554 0.3315
#[2,] -0.0307 0.0362 -0.0771 -0.3856
#[3,] -0.0940 -0.3823 -0.2095 0.0683
# SP.POP.TOTL SL.UEM.TOTL.ZS EF KOF HDI
#[1,] 0.3541 0.243 0.300 0.341 0.355
#[2,] 0.0135 0.778 -0.447 0.153 0.117
#[3,] 0.0817 0.489 0.684 -0.259 -0.127
#
# Fraction of Variance
#[1] 0.862 0.948 0.983 0.997 0.999 1.000 1.000 1.000 1.000
#
f <- matrix( c( 1.021391, 0.2012487,
0.0000000, 1.0000000
),byrow=TRUE,nrow=2,ncol=2)
#
# To Stabilize Model, Uncomment Next Line
# f[1,1] <- 0.99
#
h <- eye(1,2)
k <- f[1:2,1,drop=FALSE]
ES1 <- SS(F=f,H=h,K=k,z0=c( 0.4068021, 1.0000000),
output.names=c("FR1"))
tfplot(simulate(ES1,sampleT=150,noise=matrix(0,150,1),start=1950))