# Simulate a dataset from the full individual, nonlinear model
T<- 1000
n_pts <- 40
require(warningsignals)
## Collapsing example parameters
pars = c(Xo = 730, e = 0.5, a = 100, K = 1000, h = 200,
i = 0, Da = .09, Dt = 0, p = 2)
## Run the individual based simulation
ibm_critical <- sapply(1:500, function(i){
sn <- saddle_node_ibm(pars, times=seq(0,T, length=n_pts))
ts(sn$x1,start=sn$time[1], deltat=sn$time[2]-sn$time[1])
})
# Stable example parameters
pars = c(Xo = 730, e = 0.5, a = 100, K = 1000, h = 200,
i = 0, Da = 0, Dt = 0, p = 2)
## Run the individual based simulation
ibm_stable <- sapply(1:500, function(i){
sn <- saddle_node_ibm(pars, times=seq(0,T, length=n_pts))
ts(sn$x1,start=sn$time[1], deltat=sn$time[2]-sn$time[1])
})
# Resulting data
save(list=c("ibm_critical", "ibm_stable"), file="ibm_dist.rda")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.