#
# Leibenstein Basic 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.15804543,
0.14468969, 0.98257831, 0.1110937, -0.25296643,
-0.04495851, -0.03512983, 1.0971569, 0.03045473,
0.00000000, 0.0000000, 0.0000000, 1.0000000000
),byrow=TRUE,nrow=4,ncol=4)
h <- eye(3,4)
k <- (f[,1:3,drop=FALSE])
LEIB1 <- SS(F=f,H=h,K=k,z0=c(0.15804543, -0.25296643, 0.03045473, 1.0000000000),
output.names=c("I","II","III"))
print(LEIB1)
is.SS(LEIB1)
stability(LEIB1)
n <- 20
LEIB1.data <- simulate(LEIB1,sampleT=n,noise=matrix(0,n,3),start=1)
LEIB1.data2 <- simulate(LEIB1,sampleT=n,start=1)
tfplot(LEIB1.data)
AIC(l(LEIB1,LEIB1.data))
tfplot(LEIB1.data2)
AIC(l(LEIB1,LEIB1.data2))