User:Carl Boettiger/Notebook/Stochastic Population Dynamics/2010/05/07

{| width="800"
 * style="background-color: #EEE"|[[Image:owwnotebook_icon.png|128px]] Stochastic Population Dynamics
 * style="background-color: #F2F2F2" align="center"|  |Main project page
 * style="background-color: #F2F2F2" align="center"|  |Main project page


 * colspan="2"|
 * colspan="2"|

Likelihood calculation

 * Implemented the likelihood calculation in simulate.R code.
 * See today's revision changes via github
 * beetle_sim updated to return the full simulation to R.
 * likelihood calculation by simulation done in parallel

Decent estimates of likelihood may be challenging: Modifying default settings for longer tome series:

... Likelihood estimates differ significantly on same data. Compute times for the above runs on dual core are ~ minute, on our 8 core server ~ 10 seconds.

Challenges

 * Initializing simulation: State-space of the individual based model doesn't really reduce to the five-dimensional stages. State is actually specified by the continuously valued age of every individual, so state space varies as population size fluctuates and is quite much larger.  Though the age class groupings are intended as an approximation to this, there are several possible ways to initialize the simulation during each time interval for the likelihood calculation.  Currently starting all individuals of a given age class at the beginning of the age class, but might make a significant difference if the ages are or aren't synchronized.
 * Still haven't added heterogeneity in age maturity or in cannibalism rates.
 * Non-independence of states: State-space for the likelihood calculation is essentially five-dimensional: at each point in time have the population abundance in each of the five age classes (egg, immature larva, asymptotic-sized larva, pupae, adults). Of course probability of occupancy in each class isn't independent of the other classes, so likelihood of the entire distribution of states can't be computed directly.
 * Comparison to LPA model will have to collapse larval class and ignore egg class?

Code Notes

 * Consider returning log likelihoods directly from kernel density estimator for greater speed.


 * Answered a question on gsl-help regarding kernel density estimation. Should expand these functions to allow for other bandwidth methods, etc.


 * Code needs doxygen documentation.


 * kde library needs .cpp extension, seems that R gets confused mixing C and C++ code? Compiles fine by makefile but not by R when extensions don't match.


 * }