# Cut-and-paste code below into window above and Run
#
# France (FR_LM) Model (1950-2000)
#
#
# Measurement Matrix Growth-HOURS), (HOURS+N-X), (L-X-XREAL)
# Q N U HOURS XREAL X L
#[1,] 0.3847 0.3761 0.386 -0.354 0.387 0.376 0.380
#[2,] 0.2382 0.4172 0.190 0.669 -0.136 -0.407 0.318
#[3,] -0.0996 0.0608 -0.157 -0.561 -0.415 -0.438 0.532
#
#Fraction of Variance
#[1] 0.945 0.998 0.999 1.000 1.000 1.000 1.000
#
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)
f <- matrix( c( 1.011467560, 0.04201879, 0.0927857, 0.1703822402,
-0.025432137, 0.98935295, -0.1283416, 0.0009346911,
-0.008087302, 0.01927737, 1.0987168, -0.0064823813,
0.00000000, 0.0000000, 0.0000000, 1.0000000000
),byrow=TRUE,nrow=4,ncol=4)
#
# To stabilize model, uncomment next line
# f[1,1] <- 0.952276630; f[2,2] <- 0.93145617; f[3,3] <- 1.0344201
# To create a Steady-State Economy, uncomment next line
# f[1,1] <- 0.952276630; f[2,2] <- 0.93145617; f[3,3] <- 0.92
#
h <- eye(3,4)
k <- (f[,1:3,drop=FALSE])
FR_LM <- SS(F=f,H=h,K=k,z0=c(0.1703822402, 0.0009346911, -0.0064823813, 1.0000000000),
output.names=c("FR1","FR2","FR3"))
print(FR_LM)
is.SS(FR_LM)
stability(FR_LM)
#FR_LM.data <- simulate(FR_LM,sampleT=100,start=1950)
FR_LM.data <- simulate(FR_LM,sampleT=100,noise=matrix(0,100,3),start=1950)
FR_LM.f <- forecast(l(FR_LM,FR_LM.data),horizon=150)
FR_LM.fx <- merge.forecast(FR_LM.f)
tfplot(FR_LM.f)
AIC(m <- l(FR_LM,FR_LM.data))
FR_LMx <- SS(F=f,H=h,Q=eye(4,3),R=eye(3,3),z0=c(0.1703822402, 0.0009346911, -0.0064823813, 1.0000000000),
output.names=c("FR1","FR2","FR3"))
shockDecomposition(FR_LMx)
AIC(m <- l(FR_LM,FR_LM.data))