#
# Leibenstein Expanded Model (Cut an paste code in window above and Run (Cmd-Enter)
#
AIC <- function(model) {informationTestsCalculations(model)[3]}
require(dse)
require(matlab)
f <- matrix( c(0.68794694, -0.23702406, -0.3702652, 0, 0, 0.15804543,
0.14468969, 0.98257831, 0.1110937, 0, 0, -0.25296643,
-0.04495851, -0.03512983, 1.0971569, 0, 0, 0.03045473,
-0.14468969, -0.98257831, -0.1110937, 0, 0, 0.25296643,
-0.68794694, 0.23702406, 0.3702652, 0, 0, -0.15804543,
0.00000000, 0.00000000, 0.0000000, 0, 0, 1.00000000
),byrow=TRUE,nrow=6,ncol=6)
h <- eye(5,6)
k <- (f[,1:5,drop=FALSE])
LMx <- SS(F=f,H=h,K=k,z0=c( 0.15804543, -0.25296643, 0.03045473, 0.25296643, -0.15804543,1),
output.names=c("I","II","III","V","-I"))
print(LMx)
is.SS(LMx)
stability(LMx)
n <- 20
LMx.data <- simulate(LMx,sampleT=n,noise=matrix(0,n,5),start=1)
LMx.data2 <- simulate(LMx,sampleT=n,start=1)
tfplot(LMx.data)
AIC(l(LMx,LMx.data))
tfplot(LMx.data2)
AIC(l(LMx,LMx.data2))