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

{| 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"|

Summary

 * Have a functional likelihood calculation from the full individual-based simulation, see Friday.  Accuracy needs more testing, and the computation is probably too slow for optimization routines.
 * Have an implementation of the linear decrease in stability model with analytic conditional probability density.  Needed a couple adjustments today.
 * Need to add direct simulation to the warning signals package, currently retunrs only time-averaged/ensemble averaged stats. Can be approximated by setting the window equal to the timestep and ensembles equal to one.

Revising & Testing the math
Revisions to the equations from Thursday's entry:
 * Added an alpha_0 parameter -- the alpha dynamics shouldn't start at zero.
 * The variance integral had a factor of two that wasn't carried through. Also this calculation changes as a result of the alpha_0
 * The resulting analytical solution for the variance depends on a difference of error functions, which has poor numerical behavior for small beta. Implemented a flag in the R code which drops down to the analytic solution of beta=0 when it begins to run into this numerical round-off, otherwise numerics return variance of zero.  Compared to analytic simulations.

Effective model choice: absence of a warning signal

 * 1) Generate a data set that does not contain a warning signal, using the OU model.
 * 2) Fit both model with changing stability and the simple OU model.

Analysis of Results

 * So bad news is fit of the richer model can depend on initial conditions, and maximizing likelihood alone doesn't guarantee finding the right parameters.
 * Luckily this alternate peak seems to have broader uncertainty
 * Good news is that both approaches achieve the likelihood of the true parameter values. Any information criterion would successfully reject the change of stability model in this case.

Code Updates

 * Warning Signals project has also migrated to Github. Nicer interface, git is much faster, handles branching & merging very elegantly and this centralizes my projects.
 * the optimization function in R takes control argument for maximum number of iterations as demonstrated above, though we don't hit the default max (100) yet, which is promising for being able to optimize the individual-based model over at least a subset of parameters.
 * Ironically the sde_likelihood library for this analysis has been developed in the Structured-Populations package, though it has now been integrated into the warningSignals package.
 * Handy: function formals gives the arguments/defaults of an R function.
 * Should look into how mle is calculating the standard error estimate on parameters.

Misc

 * Joined Nature's SciTable, aimed at undergraduates and professors teaching mostly. We'll see if it's any use.
 * Statistics on Social media, youtube-style.
 * Persuasive case for twitter, a social sixth sense?
 * 100 twitter tips.
 * added category tags to notebooks yesterday. Should help organize the subprojects in each notebook.


 * }