The Malthusian Controller
## Cut and paste this R-code into the box above and Run(Cmd-Enter).
# Malthus Model (Q-N) Controller## Measurement Matrix # Q N#[1,] 0.7071 0.7071#[2,] 0.7071 -0.7071## Fraction of Variance #[1] 0.8927 1.0000#AIC <- function(model) {informationTestsCalculations(model)[3]}require(dse)require(matlab)f <- matrix( c(1.1161070, 0.6224717, 0.4093143, -0.3811407, 0.2287558, -0.6537930, 0.000000000, 0.0000000 ,1.0000000),nrow=3,ncol=3, byrow=TRUE)h <- eye(2,3)q <- matrix(c(0.7765244, 0.06684033, -0.4960544, 0.02456354, 0,0),nrow=3,ncol=2,byrow=TRUE)r <- matrix(c(0.9875125, 0.0000000, -0.5231486, 0.1073789),nrow=2,ncol=2,byrow=TRUE)
DEL19_Malthus <- SS(F=f,H=h,Q=q,R=r,z0=c( 0.4093143, -0.6537930, 1.0000000), output.names=c("Growth","Q-N"))print(DEL19_Malthus)is.SS(DEL19_Malthus)stability(DEL19_Malthus)# help(simulate)DEL19_Malthus.data <- simulate(toSSinnov(DEL19_Malthus),sampleT=50,noise=matrix(0,50,2),start=1872)seriesNames(outputData(DEL19_Malthus.data)) <- c("Growth","Q-N")tfplot(DEL19_Malthus.data,end=1890)m <- l(DEL19_Malthus,DEL19_Malthus.data)mshockDecomposition(m)
# Malthus Model (Q-N) Controller## Measurement Matrix # Q N#[1,] 0.7071 0.7071#[2,] 0.7071 -0.7071## Fraction of Variance #[1] 0.8927 1.0000#AIC <- function(model) {informationTestsCalculations(model)[3]}require(dse)require(matlab)f <- matrix( c(1.1161070, 0.6224717, 0.4093143, -0.3811407, 0.2287558, -0.6537930, 0.000000000, 0.0000000 ,1.0000000),nrow=3,ncol=3, byrow=TRUE)h <- eye(2,3)q <- matrix(c(0.7765244, 0.06684033, -0.4960544, 0.02456354, 0,0),nrow=3,ncol=2,byrow=TRUE)r <- matrix(c(0.9875125, 0.0000000, -0.5231486, 0.1073789),nrow=2,ncol=2,byrow=TRUE)
DEL19_Malthus <- SS(F=f,H=h,Q=q,R=r,z0=c( 0.4093143, -0.6537930, 1.0000000), output.names=c("Growth","Q-N"))print(DEL19_Malthus)is.SS(DEL19_Malthus)stability(DEL19_Malthus)# help(simulate)DEL19_Malthus.data <- simulate(toSSinnov(DEL19_Malthus),sampleT=50,noise=matrix(0,50,2),start=1872)seriesNames(outputData(DEL19_Malthus.data)) <- c("Growth","Q-N")tfplot(DEL19_Malthus.data,end=1890)m <- l(DEL19_Malthus,DEL19_Malthus.data)mshockDecomposition(m)