# Cut-and-Paste Code below into Window Above and Run
#
# IN_LM India 1950-2000+ (IN)
#
# Measurement Matrix
# Q N
#[1,] 0.707 0.707
#[2,] 0.707 -0.707
#
# Fraction of Variance
#[1] 0.992 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.02900365, -0.1043974, 0.0940567465,
0.01197189, 0.9807005, -0.0006520039,
0.000000000, 0.00000000, 1.0000000000)
,byrow=TRUE,nrow=3,ncol=3)
#
# To stabilize the System, Uncomment following line
# f[1,1] <- 0.98
h <- eye(2,3)
k <- (f[,1:2,drop=FALSE])
IN_LM <- SS(F=f,H=h,K=k,z0=c(0.0940567465, -0.0006520039, 1.0000000000),
output.names=c("IN1","IN2"))
print(IN_LM)
is.SS(IN_LM)
stability(IN_LM)
tfplot(IN_LM.data <- simulate(IN_LM,sampleT=150,start=0))
#IN_LM.data <- simulate(IN_LM,sampleT=20,noise=matrix(0,20,2))
IN_LM.f <- forecast(m <- l(IN_LM,IN_LM.data),horizon=50)
tfplot(IN_LM.f)
AIC(m)
shockDecomposition(toSSChol(m))