Code from Clements, McCarthy, and Blanchard (2019) Nature Coms - "Early warning signals of rocovery in complex systems". Simulation data available on request.
These simulations rely on a stochastic version of the Mizer package (https://github.com/sizespectrum/mizer). This is currently in the pipeline to be released into the Mizer R package. It isn't currently available as source code.
Many thanks to Julia Blanchard for the stochastic version of Mizer.