SlideShare a Scribd company logo
1 of 56
Download to read offline
Cycles in finite populations
                 —
A reproducible seminar in three acts

          Mario Pineda-Krch


           October 31, 2011




                                       1
Act 1: The ghost of Fermat
(The what, why and how of reproducible research)


Act 2: A tale of two cycles
(Demonstrating the existence of quasi-cycles using reproducible
research)


Act 3: Cycles at the edge of existence
(Emergence of quasi-cycles in strongly destabilized ecosystems)




                                                                  2
Act 1: The ghost of Fermat




                             3
Irreproducible research
   Randall J. LeVeque (2006)
   “Scientific and mathematical journals are filled with pretty pictures
   these days of computational experiments that the reader has no
   hope of repeating. Even brilliant and well intentioned
   computational scientists often do a poor job of presenting their
   work in a reproducible manner. The methods are often very
   vaguely defined, and even if they are carefully defined they would
   normally have to be implemented from scratch by the reader in
   order to test them. Most modern algorithms are so complicated
   that there is little hope of doing this properly.”

   Pierre de Fermat (1637)
   “It is impossible to separate a cube into two cubes, or a fourth
   power into two fourth powers, or in general, any power higher than
   the second, into two like powers. I have discovered a truly
   marvellous proof of this, which this margin is too narrow to
   contain.”
                                                                         4
What really happened?




          Reproducible results = Reproducible research



                                                         5
Reproducible research: It’s not the destination. It’s the
journey.




                                                            6
Reproducible research: The What


   LeVeque (2006):
  “The idea of reproducible research in scientific computing is to
  archive and make publicly available all of the codes used to create
  the figures or tables in a paper in such a way that the reader can
  download the codes and run them to reproduce the results.”

   Wikipedia:
  “Reproducibility is one of the main principles of the scientific
  method, and refers to the ability of a test or experiment to be
  accurately reproduced, or replicated, by someone else working
  independently.”
Reproducible research: The Why



   American Physical Society
  “Science is the systematic enterprise of gathering knowledge about
  the universe and organizing and condensing that knowledge into
  testable laws and theories. The success and credibility of science
  are anchored in the willingness of scientists to: Expose their ideas
  and results to the independent testing and replication by others.
  This requires the open exchange of data, procedure and materials.”
   Reproducability = Transparency + Executability




                                                                         8
Journal article




                                    Reader
         6
               Processed data


                  Raw data


             Computer simulations


               Computer code
Author




                  Algorithms        ?



                                             9
Literate programming
A paradigm for reproducible research in computational sciences




  “The idea is that you do not
  document programs (after the
  fact), but write documents
  that contain the programs.”
  — John Max Skaller
Literate programming according to Donald Knuth




                               Prose


                       Weave           Tangle



       Documentation                            Program




                                                          11
Literate programming systems




      LP system   Document formatting language   Programming language   Inventor(s)    Year
      WEB         TEX                            Pascal                 Knuth          1992
      CWEB        TEX                            C/C++/Java             Knuth & Levy   1993
      FWEB        L TEX
                   A                             C/C++/FORTRAN          Krommes        1993
      noweb       TEX/L TEX/HTML/troff
                        A                        agnostic               Ramsey         1999
      Sweave      L TEX
                   A                             R                      Leisch         2002
      PyLit       reStructuredText               Python                 Milde          2005
      Pweave      L TEX/reST/Sphinx/Pandoc
                   A                             Python                 Pastell        2010




                                                                                              12
Literate programming according to R
The evolution of the literate programming paradigm




                                       Prose


                        Sweave                       Stangle



            Documentation                                  Code




                                                                  13
What really happens

                              Prose


                Sweave                   Stangle

                          Sweave

       Documentation                           Code


                               Execute


                       Integrate
                                               Results


                                                         14
This research is reproducible!




       These slides are prepared using Sweave.

       These slides are executable (look for               ).
       The full project (source, code, results, etc.) will be available
       at http://pineda-krch.com.




                                                                          15
Implementing reproducible research



      Attach code to publish results is good...,
      executable manuscripts are better.
      Adopt a habit of reproducibility, i.e. make it routine and
      require it from others (students, postdocs, colleagues).
      Keep reproducibility in computational research to the same
      rigorous standard as reproducibility in mathematical proofs.
      Demand reproducibility in your role as journal editor and
      reviewer of manuscripts and grants applications.
Act 2: A tale of two cycles




                              17
Olaus Magnus (1555) Historia de Gentibus




    First known depiction of of population cycles in Olaus Magnus’
    Historia de Gentibus Septentrionalibus (History of the Northern
    Peoples) (1555) shows lemmings falling from the sky with two
                weasels with lemmings in their mouths.



                                                                      18
Elton (1924) British Journal of Experimental Biology




                                                       19
Kendall et al. (1998) Ecology Letters




                                        20
Fluctuating populations
                                                                         Lynx




                             60000
                             20000
                             0


                                                 1750          1800                1850           1900

                                                                         Otter
                                                                         Years
                             10000 14000 18000
           Population size

                             6000




                                                 1850   1860    1870    1880        1890   1900     1910

                                                                       Wolverine
                                                                         Years
                             2500
                             1500
                             500
                             0




                                                 1750          1800                1850           1900
Explaining complex population dynamics using simple
models

      Classical Lotka-Volterra
          Exponential growth in prey, linear (Type 1) functional response
          in predator
          Structurally unstable, mainly of historical interest

      Lotka-Volterra
          Logistic growth in prey, linear (Type 1) functional response in
          predator
          Does not cycle

      Rosenzweig-MacArthur
          Logistic growth in prey, non-linear (Type 2) functional
          response in predator (i.e. satiation)
          Cycles
Rosenzweig-MacArthur predator-prey model (RMPP)




             dN            N
                  = rN 1 − K   − 1 +awN NP
             dt

             dP   = c 1 +awN NP − gP
             dt




                                                  23
The deterministic RMPP in R
   > ode.rmpp <- function(parms = stop('Missing parms!'),
                             x0 = stop('Missing x0!'),
                           tmax = stop('Missing tmax')){
      det.rmpp=function(t, y, parms){
         N=y[1] ; P=y[2]
         with(as.list(parms),{
           dN = (b-d)*N*(1-N/K)-a/(1+w*N)*N*P
           dP = c*a/(1+w*N)*N*P-g*P
           out=c(dN, dP)
           list(out)
         })
      }
      require(odesolve)
      time <- seq(0, tmax, by=1)
      pop <- c(N=x0[['N']]*0.75, P=x0[['P']]*1.25)
      res = as.data.frame(lsoda(pop, time, det.rmpp, parms))
      return(ode.res = res)
    }
The stochastic RMPP in R


   > ssa.rmpp <- function(parms = stop('Missing parms!'),
                            x0 = stop('Missing x0!'),
                          tmax = stop('Missing tmax')){
      command <- paste('../src/ssa_rmpp ',
                       parms[['b']], parms[['d']],
                       parms[['K']], parms[['a']],
                       parms[['w']], parms[['c']],
                       parms[['g']], x0[['N']], x0[['P']],
                       tmax, '>../results/out.txt')
      system(command)
      res <- as.data.frame(read.csv('../results/out.txt',
                           skip=1, header=TRUE))
      return(ssa.res = res)
    }
Structure of simulation model

                         rmpp.R




        ode.rmpp.R                ssa.rmpp.R




                                  ssa_rmpp.c


                                               26
Run a simulation in the stable node region

   Set the parameters
   >   alpha <- 0.5
   >   beta <- 1
   >   gamma <- 1.2
   >   alpha; beta; gamma
   [1] 0.5

   [1] 1

   [1] 1.2

   Set equilibrium population size
   > eq <- 1000
   Set the length and the number of simulations
   > tmax <- 10000
   > n <- 1



                                                  27
Run a simulation in the stable node region

   Run the simulation
   > fn.node <- rmpp(alpha, beta, gamma, tmax, eq, n)
   Data was saved in
   > fn.node
   [1] "../results/rmpp-alpha0.5-beta1-gamma1.2-eq1000-1.RData"

   Loading the data
   > load(fn.node)
   Looking at the contents of the data file
   > ls()

    [1]   "alpha"       "beta"       "d.lynx"       "d.otter"     "d.wolverin
    [6]   "eq"          "fn"         "fn.node"      "gamma"       "i"
   [11]   "n"           "ode.res"    "ode.rmpp"     "parms"       "rmpp"
   [16]   "ssa.res"     "ssa.rmpp"   "start.time"   "tmax"        "x0"



                                                                         28
Plot results
   >   layout(matrix(c(1,2), ncol=2))
   >   ymax <- max(c(ode.res$N, ode.res$P, ssa.res$N, ssa.res$P))
   >   ymin <- min(c(ode.res$N, ode.res$P, ssa.res$N, ssa.res$P))
   >   plot(N~time, ode.res, type='l', lwd=3, col=rgb(0,1,0,.75),
           xlab="Time", ylab="Population size", xlim=c(0, 250), ylim=c(ymin, ymax), bty='n')
   >   points(P~time, ode.res, type='l', lwd=3, col=rgb(1,0,0,.75))
   >   title('Deterministic')
   >   plot(N~time, ssa.res, type='l', lwd=3, col=rgb(0,1,0,.75),
           xlab="Time", ylab="", xlim=c(0, 250), ylim=c(ymin, ymax), bty='n')
   >   points(P~time, ssa.res, type='l', lwd=3, col=rgb(1,0,0,.75))
   >   title('Stochastic')

                                                      Deterministic                                   Stochastic
                                      1400




                                                                                      1400
                                      1200




                                                                                      1200
                    Population size

                                      1000




                                                                                      1000
                                      800




                                                                                      800
                                      600




                                                                                      600
                                      400




                                                                                      400

                                             0   50    100          150   200   250          0   50   100          150   200   250

                                                             Time                                           Time




   Figure: Time series for RMPP model in stable node region (α = 0.5,
   β = 1, γ = 1.2).
Run a simulation in the limit cycle region


                                                Deterministic                                   Stochastic


                                3000




                                                                                3000
                                2000




                                                                                2000
              Population size

                                1000




                                                                                1000
                                500




                                                                                500
                                0




                                                                                0
                                       0   50    100          150   200   250          0   50   100          150   200   250

                                                       Time                                           Time




   Figure: Time series for RMPP model in limit cycle region (α = 0.5,
   β = 1, γ = 3.5).
Run a simulation in the stable focus region


                                               Deterministic                                   Stochastic


                               1500




                                                                               1500
             Population size

                               1000




                                                                               1000
                               500




                                                                               500
                                      0   50    100          150   200   250          0   50   100          150   200   250

                                                      Time                                           Time




   Figure: Time series for RMPP model in stable focus region α = 0.5,
   β = 1, γ = 2.5).
Detecting periodic fluctuations in simulated time
series
                                                         Node




                             1200
                             1000
                             800
                             600




                                     100   150   200                 250   300   350

                                                         Focus
                                                          Years
                             1800
           Population size

                             1400
                             1000
                             600




                                     100   150   200                 250   300   350

                                                       Limit cycle
                                                          Years
                             2500
                             1500
                             0 500




                                     100   150   200                 250   300   350

                                                                                       32
Autocorrelation Function (ACF)
Detecting periodic fluctuations



                                     Node                                 Focus                                 Limit cycle

                      1.0




                                                      1.0




                                                                                                 1.0
                      0.8




                                                                                                 0.5
                                                      0.5
                      0.6
                ACF




                                                                                                 0.0
                      0.4




                                                      0.0




                                                                                                 −0.5
                      0.2




                                                      −0.5
                      0.0




                            0   10    20    30   40          0   5   10    15     20   25   30          0   5   10   15   20   25   30

                                                                           Lag




                                           √
     Evidence of periodicity if ACF(T) > 2/ tm where T is the lag of
     the dominant frequency (first maximum), tm is the number of data
     points in the time series.


                                                                                                                                         33
Power spectra
Detecting periodic fluctuations




                                                          Node                                                             Focus                                                 Limit cycle
                               8




                                                                                               8




                                                                                                                                                               8
                                                                                                                                                                                                     q
                                                                                                                                                                                                     q
                                                                                                                                                                                                     q
                                                                                                                                                                                                     q
                                                                                                                                                                                                     q
                                                                                                                                                                                                     q
                                                                                                                                                                                                     q
                                                                                                                                                                                                     qq
                                                                                                                                                                                                     q
                                                                                                                                                                                                    qqq
                                                                                                                                                                                                    qq
                                                                                                                                                                                                    qq
                                                                                                                                                                                                    q
                                                                                                                                                                                                    q
                                                                                                                                                                                                   qq
                                                                                                                                                                                                   q
                                                                                                                                                                                                   qq q
                                                                                                                                                                                                   q
                               6




                                                                                               6




                                                                                                                                                               6
                                                                                                                                                                                                  q qq
                                                                                                                                                                                                  q
                                                                                                                                             qq                                                   q qq
                                                                                                                                                                                                  q
                                                                                                                                                                                                 qq q
                                                                                                                                           qq                                                         q
                                                                                                                                                                                                      qq
                                                                                                                                            q
                                                                                                                                            qq
                                                                                                                                            qq
                                                                                                                                            qq                                                   qq qq
                                                                                                                                                                                                 qq qqq
                                                                                                                                           qqq
                                                                                                                                            qq
                                                                                                                                             q
                                                                                                                                            q qq                        q        q        q
                                                                                                                                                                                          q    qq q
                                                                                                                                                                                                q
                                                                                                                                                                                                q
                                                                                                                                                                                               qq q q
                                                                                                                                            qq
                                                                                                                                             qqq                                q     qq q q q qq q q
                                                                                                                                                                                                  q q  q
                                                                                                                                          q qq
                                                                                                                                         q qqqqq
                                                                                                                                               q                          q         qq q qq q
                                                                                                                                                                                            q q
                                                                                                                                                                                             q         qq
                                                                                                                                                                                                        q
                                                                                                                                                                                                        qq
                                                                                                                                                                                                       qq q
                                                                                                                                                                                                        q q
                                                                                                                                        qq qq q
                                                                                                                                              q                                          q q qq q qq q
                                                                                                                                                                                            q qq         q
                log10(Power)




                                                                                                                                           qq                                  q q                      qq q
                                                                                                                                          q qq q
                                                                                                                                        q q q qq q
                                                                                                                                    q q qq q qqq
                                                                                                                                               q                    q       q q q q qq qq qqqq q qqq q   q q
                                                         qq q q q q                                                                        q q qqq                                     qqqqq q q
                                                                                                                                                                                        q      q        q q  q
                                                           q
                                                 q q q qq q qq q qq q q
                                                                                                                              q     q qqq qqq
                                                                                                                                  qq qqq qqqqq   q
                                                                                                                                                qq
                                                                                                                                                                                           qqq q        qq q q
                                                                                                                                                                                                         q q
                                                                                                                                                                                                        q qq qq
                                                                                                                                                                                                        qqq q
                                                               q q
                                                             q q q                                                            q    q           qqq q
                                                                                                                                                q                            q     q q qq qq qq        qq qq q
                                                                                                                                                                                                        qq qqq
                                                                                                                                                                                                         q
                                                                    q qq q q q
                                                       q q q q qqqqqqqq qq q q
                                                      q q q q q qq qqqq qqqq qqqq
                                                                           q qqq           q                                       q
                                                                                                                              q qq qq q q qqq qq
                                                                                                                                               qqqq
                                                                                                                                                q qqqq
                                                                                                                                                  q                                                    qqqq qq
                                                                                                                                                                                               q q q qqqqqq q
                                                                                                                                                                                                          q
                                                                                                                                                                                                        qqqqqq
                                                                                                                                                                                                         q qqq
                                             qq                q q q q q qqqqqqq qq
                                                               q q q q qqqqqqqq
                                                                           q qq
                                                                           q q qq q
                                                    q q q q qqqqqqqqqqqqqqqqqq
                                                         q q q qqqqq qqqqqqqqqq
                                                                                                    q           q                           q qq q q
                                                                                                                               q q q qq q q qq qq
                                                                                                                              q q q qq q qq qqq qqq
                                                                                                                                                   q                                                     q q qqq
                                                                                                                                                                                                        qq qqqqqq
                                                                                                                                                                                                            qqqq
                                                                      q qq qq q q q
                                                                            q q
                                                                q qqq qqqqqqqq q q q
                                                                q qqqqqqqqqqqqqqq
                                               qq qqq q q qqqqqqqqqqqqqqqqqqq
                                                        q qq q qqqqqqq qqqqqqqqqq
                                                                    qq qqqqqqq qq q                                                   q          qq q q
                                                                                                                                                   qq                                     q              qq qqq
                                                                                                                                                                                                     q qqqqqqq q
                                                                                                                                                                                                                q
                                                                                                                                                                                                          q qqqqq
                                                                                                                                                                                                               q q
                                                                     q
                                                                     qq q q q qqqqqqqq
                                                                q qqqqqqqqqqqqqqqq                                                   q             q q
                                                                                                                                                qqqq qqq                                                 qqqqqq
                                                                                                                                                                                                          q qq
                               4




                                                                                               4




                                                                                                                                                               4
                                                                              q q qq
                                                                                   q q                                                           qq q q
                                                                                                                                       q q qqqqqqq                                                             q
                                                                                                                                                                                                         qqqqq q
                                                                         q q qqqqqqqqq
                                                                  qqqqqqqqqqqqqqqq q
                                                                       qqq qqqqqqqqq
                                                                            q q q qqqqq
                                                                          qqqqqqqqqqq
                                                            qqq qqqqqqqqqqqqqqqqqqq q qq
                                                                    qq qqqqqqqqqqqq
                                                                         qqqq qqqqqq q
                                                                                         q                  q          q qq          q qq           qq q
                                                                                                                                                     qq
                                                                                                                                                     qq q                                    qqq              qqqq
                                                                                                                                                                                                          q qq q
                                                                                                                                                                                                          q q qqq
                                          q     qqqq qq q q qqqqqqqqqqqqqqqqqq
                                                                           q q q qqqqq
                                                                            q q q qq qq
                                                                q q qq qqqqqqqqqqqqq
                                                            qqq qqq qqqqqqqqqqqqqq
                                                                   qqq qqqqqqqqqqqq
                                                                      q qqqqqqqqqqqq
                                                             q q q qqqqqqqqqqqqqqqq
                                                                            q q q q q qq                              q q q
                                                                                                                           q    q qqq qq           qqqqq
                                                                                                                                                      q
                                                                                                                                                    qqqq
                                                                                                                                                 qqqqqqq
                                                                                                                                                  q qqqqq
                                                                                                                                                      q qq
                                                                                                                                                                                             q q
                                                                                                                                                                                              q q         q q qqq
                                                                                                                                                                                                              qq q
                                                                                                                                                                                                        qq qqqqq
                                                                                                                                                                                                              q qq
                                        q
                                                      q q qqqq qqqqqqqqqqqqqqqqqqq qqqq
                                                                        q qqqqqqqqqqq
                                                                       qqqqqqqqqqqqqq
                                                              q qq qqqqqqqqqqqqqq
                                                                        q qqqqqqqqqqqqqq q
                                                                                                        q                             q q        q qqqqq
                                                                                                                                                      qq q
                                                                                                                                                  q qqqqq
                                                                                                                                                   q q qqq                             q                   q q qq
                                                                                                                                                                                                              q qq
                                                                                                                                                                                                             qqqq  q
                                                                        q qqqqqqqqqq
                                                                               qq qqqqq
                                                                              q qqqqqqq
                                                                                q q qqq
                                                                   qq qqqqqqqqqqqqqq
                                                                        q qqqqqqqqqq
                                                                  q q qqqqqqqqqqqqqq   q q
                                                                                     qqqq
                                                                         q q qq qqqqqq
                                                                               q qqqqqqq
                                                                                         qq                          qq q      qq       qq
                                                                                                                                        q             qq q
                                                                                                                                                     qq qq
                                                                                                                                                    qqqqq
                                                                                                                                                       q q
                                                                                                                                                   qqqqq
                                                                                                                                                           q
                                                                                                                                                           q
                                                                                                                                                           q                                          q qqqqqqq qq
                                                                                                                                                                                                             qqqqq q
                                            q                          qq qqqqqqqqqqq
                                                          q q q qq qqqqqqqqqqqqqqq
                                                                   q qq qqqqqqqqqqq
                                                                              q qqqqqqq
                                                       q qq q q qqq qqqqqqqqqqqqqq
                                                                        q qqqqqqqqqq
                                                                 q q qqqqqqqqqqqqqq
                                                                               qqqqqqq q
                                                                                   q qq
                                                                               q q q qq
                                                                  q qqqqqqqqqqqqqq
                                                                         qqqq qqqqqqqq                                         qq q
                                                                                                                                                     qq qq
                                                                                                                                                        qq
                                                                                                                                                       q qq
                                                                                                                                                       qqqq                        q                      q q qqq
                                                                                                                                                                                                             q qq
                                                                                                                                                                                                           qqq qq
                                                                                                                                                                                                                  q
                                                                                                                                                                                                                  q
                                                                                                                                                                                                                 qq
                                                          q qqqqqqqqqqqqqqqqqqqqqqqqqqq
                                                                              q qqqqqqqq
                                                                                   qqqqq
                                                                           q qqqqqqqqqq
                                                                             qqqqqqqqq
                                                                                     qqqq
                                                                                  q qqqqqqq
                                                                                         q                                    qq                        qq
                                                                                                                                                 q q qqqq
                                                                                                                                                    q qqq
                                                                                                                                                    q qq                                         q         qqq qqq
                                                                                                                                                                                                             q qqq
                                                                                                                                                                                                             q qqqq
                                                  q                              q qqqqq
                                                                 qq qqqqqqqqqqqqqqq
                                                                     qq q qqqqqqqqqqq
                                                                      q q qqqqqqqqqq
                                                            qq qq qqqqqqqqqqqqqqq
                                                                                      qqqq
                                                                               qqqqqqqq
                                                                               qqqqqqqq  q                                   q q                        qq                                                    q qq
                                   q                q      q       qqqqq qqqqqqqqqqq
                                                                               q q qqqqq
                                                                        q qqqqqqqqqqq
                                                                          q qq qqqqqq q qq
                                                                               q q qqqqq
                                                                                q q qqqq
                                                                          q qqqqqqqqqq
                                                                          q qqq qqqqqqqqq q
                                                                                          q
                                                                                         qqq
                                                                                           q                             q                        q q q qq
                                                                                                                                                 qq qq qq
                                                                                                                                                  qq qq
                                                                                                                                                         qq
                                                                                                                                                          q                                                qq qqqq
                                                                                                                                                                                                              q qq
                                                                                                                                                                                                              q qq
                                                                                                                                                                                                                 qqq
                                                                 q qq qqqqqqqqqqqq
                                                                          q qqqqqqqqq
                                                                                q qq qqqq
                                                              q qq q qqqqqqqqqqqqq
                                                                 q q q qq qqqqqqqqq    qqq
                                                                                       qqq
                                                                                          q                                      q q       q        q qq
                                                                                                                                                     q qq
                                                                                                                                                           q                                                 qq q
                                                                                                                                                                                                          q qq q  qq
                                                                                                                                                                                                                   q
                                                   q         q q q qqqqqqqqqqqqqq qqqqqq
                                                                                  qqqqqq
                                                                                    qqqqq
                                                                                qqqqqqq
                                                                          q qqqqqqqqqq
                                                                             qqqqqqqqq
                                                                                    qqqqq
                                                                          q qqqqqqqqqq
                                                                                  qqqqqq
                                                                             qq qqqqqqq
                                                                                          q
                                                                                          qq                                                          qqq
                                                                                                                                                  qqq qq qq                                                    q q
                                                                                                                                                                                                               qqqq
                                                                                                                                                                                                                qqq
                                                     q q      q            qqqqqqqqqq
                                                                      q q qq qqqqqq
                                                                           q q q qqqqq
                                                                              q       qqqq
                                                                                   qqqqqq
                                                                                        qq
                                                                                    qqqqq
                                                                        qq q q qqqqqqqq q q
                                                                                          q
                                                                                          q                         q                                qqqq
                                                                                                                                                       qqq
                                                                                                                                                           q                                                    qqqq
                                                                    qqqqqq qqqqqqqq
                                                                           q qqqqqqq
                                                                          q q qqqqqqq
                                                                          q q q qqqqqq
                                                                                      qqq
                                                                                       q q
                                                                                    q qqq
                                                                                   q qqq
                                                                                                                                         q      q qqq qq qq
                                                                                                                                                       qq
                                                                                                                                                       qq q                                                    qq
                                                                                                                                                                                                              q qq q
                                                                                 qq qqqqq
                                                                                 q qqqqqq
                                                                                       qqq
                                                                                    q qqqq
                                                                                 qq qqqq
                                                                                 qq qqqqqq q                                                          q qq                                                       qq
                                                                                                                                                                                                                 q
                                                        q                   qq qq qqqq
                                                                            qq qq qqqqqqqq
                                                                            q q qq q qqq
                                                                                  q qqqqq
                                                                     q qq q q qqqqqqq
                                                                                          q
                                                                                         qq
                                                                                         qq
                                                                                        qq q
                                                                                                                             q
                                                                                                                                 q
                                                                                                                                      q            q qqq  q
                                                                                                                                                          q
                                                                                                                                                          q                                                      q
                                                                                     qqqq
                                                                           q q qqqqqqq
                                                                                      qqq
                                                                                  q q qqq
                                                                                  q q qqq
                                                                        q q q q qqqqqq
                                                                            q q qqqqqq qq  q                                                      qq                                                              q
                               2




                                                                                               2




                                                                                                                                                               2
                                                                                  q qqqqq
                                                                       q q qqq qqqq
                                                                                  q qqqqq
                                                                                       qq
                                                                                        qq                                                            q
                                                      q               q     q q qq qqqq
                                                                                     q qqq
                                                                                        qq                                                           q q
                                                                        qq qq q qqq  q q
                                                                                    q qqq
                                                                                    q q qqq                                                             q                                                         q
                                                                         q      qqqq qq
                                                                                    q qq qq
                                                                                           q                                                           qq
                                                               qq                 q qq q
                                                                             qq q qqq  qqq
                                                                                        qq
                                                                                         q                                                              q                                                     q
                                                                              q q        qq
                                                                      q             qq q                                                                                                                     q
                                                                                    q qq
                                                                                       q                                                                                                                          q
                               0




                                                                                               0




                                                                                                                                                               0
                                                                                       q
                                   −4            −3             −2            −1                   −3.0 −2.5 −2.0 −1.5 −1.0 −0.5                                   −3.0 −2.5 −2.0 −1.5 −1.0 −0.5

                                                                                                            log10(Cycle frequency)




     Evidence of periodicity: presence of dominant frequency peak




                                                                                                                                                                                                                       34
Marginal distribution
Distinguishing between quasi-cycles and noisy limit cycles




                                           Node                                Focus                                    Limit cycle




                                                                                                        150
                             3000




                                                              200
                             2500




                                                              150




                                                                                                        100
                             2000
                 Frequency

                             1500




                                                              100
                             1000




                                                                                                        50
                                                              50
                             500
                             0




                                                              0




                                                                                                        0
                                    600   800   1000   1200         600     1000      1400       1800         0   500     1500        2500

                                                                          Prey population size




     Evidence of limit cycle: bimodal distribution




                                                                                                                                             35
Pineda krch cmb2011-slides
Pineda krch cmb2011-slides
Pineda krch cmb2011-slides
Pineda krch cmb2011-slides
Pineda krch cmb2011-slides
Pineda krch cmb2011-slides
Pineda krch cmb2011-slides
Pineda krch cmb2011-slides
Pineda krch cmb2011-slides
Pineda krch cmb2011-slides
Pineda krch cmb2011-slides
Pineda krch cmb2011-slides
Pineda krch cmb2011-slides
Pineda krch cmb2011-slides
Pineda krch cmb2011-slides
Pineda krch cmb2011-slides
Pineda krch cmb2011-slides
Pineda krch cmb2011-slides
Pineda krch cmb2011-slides
Pineda krch cmb2011-slides
Pineda krch cmb2011-slides

More Related Content

Viewers also liked

Viewers also liked (8)

A sonny keraf ilmu pengetahuan
A sonny keraf   ilmu pengetahuanA sonny keraf   ilmu pengetahuan
A sonny keraf ilmu pengetahuan
 
서울사람들Process4
서울사람들Process4서울사람들Process4
서울사람들Process4
 
서울사람들기획안
서울사람들기획안서울사람들기획안
서울사람들기획안
 
Motongraphics final
Motongraphics final Motongraphics final
Motongraphics final
 
서울사람들Process1_홍대
서울사람들Process1_홍대서울사람들Process1_홍대
서울사람들Process1_홍대
 
서울사람들Process3
서울사람들Process3서울사람들Process3
서울사람들Process3
 
Final project
Final project Final project
Final project
 
서울사람들 최종
서울사람들 최종서울사람들 최종
서울사람들 최종
 

Similar to Pineda krch cmb2011-slides

you do sci-tech ah? - the scitech quiz
you do sci-tech ah? - the scitech quizyou do sci-tech ah? - the scitech quiz
you do sci-tech ah? - the scitech quizPranav Condur
 
Gold Open Science Nov 13 07
Gold Open Science Nov 13 07Gold Open Science Nov 13 07
Gold Open Science Nov 13 07guesta0e754
 
Gold Open Science Nov 13 07
Gold Open Science Nov 13 07Gold Open Science Nov 13 07
Gold Open Science Nov 13 07annagold
 
A Pioneer Speaks – A History & Future of Telepresence
A Pioneer Speaks – A History & Future of TelepresenceA Pioneer Speaks – A History & Future of Telepresence
A Pioneer Speaks – A History & Future of TelepresenceLarry Smarr
 
Visualizing Scientific Data - LATAM Faculty Summit 2011
Visualizing Scientific Data - LATAM Faculty Summit 2011Visualizing Scientific Data - LATAM Faculty Summit 2011
Visualizing Scientific Data - LATAM Faculty Summit 2011Derick Campbell
 
ATMOS 2013- SciTech Quiz
ATMOS 2013- SciTech QuizATMOS 2013- SciTech Quiz
ATMOS 2013- SciTech QuizMadhav Krishnan
 
Nanotechnology academic essay assignment - www.topgradepapers.com
Nanotechnology   academic essay assignment - www.topgradepapers.comNanotechnology   academic essay assignment - www.topgradepapers.com
Nanotechnology academic essay assignment - www.topgradepapers.comTop Grade Papers
 
SSoE InFocus, Spring 2005
SSoE InFocus, Spring 2005SSoE InFocus, Spring 2005
SSoE InFocus, Spring 2005pberzins
 
Making Molehills of Mountains
Making Molehills of MountainsMaking Molehills of Mountains
Making Molehills of MountainsIan Phillips
 
2015 10-7-11am-reproducible research
2015 10-7-11am-reproducible research2015 10-7-11am-reproducible research
2015 10-7-11am-reproducible researchYannick Wurm
 
From Research Objects to Reproducible Science Tales
From Research Objects to Reproducible Science TalesFrom Research Objects to Reproducible Science Tales
From Research Objects to Reproducible Science TalesBertram Ludäscher
 
2008—The Year of Global Telepresence
2008—The Year of Global Telepresence2008—The Year of Global Telepresence
2008—The Year of Global TelepresenceLarry Smarr
 
Geek Night 16.0 - Evolution of Programming Languages
Geek Night 16.0 - Evolution of Programming LanguagesGeek Night 16.0 - Evolution of Programming Languages
Geek Night 16.0 - Evolution of Programming LanguagesGeekNightHyderabad
 
Book naturoids
Book naturoidsBook naturoids
Book naturoidsJORGE
 
Taxonomies and Ontologies – The Yin and Yang of Knowledge Modelling
Taxonomies and Ontologies – The Yin and Yang of Knowledge ModellingTaxonomies and Ontologies – The Yin and Yang of Knowledge Modelling
Taxonomies and Ontologies – The Yin and Yang of Knowledge ModellingSemantic Web Company
 

Similar to Pineda krch cmb2011-slides (20)

you do sci-tech ah? - the scitech quiz
you do sci-tech ah? - the scitech quizyou do sci-tech ah? - the scitech quiz
you do sci-tech ah? - the scitech quiz
 
Gold Open Science Nov 13 07
Gold Open Science Nov 13 07Gold Open Science Nov 13 07
Gold Open Science Nov 13 07
 
Gold Open Science Nov 13 07
Gold Open Science Nov 13 07Gold Open Science Nov 13 07
Gold Open Science Nov 13 07
 
Art of fractals
Art of fractalsArt of fractals
Art of fractals
 
A Pioneer Speaks – A History & Future of Telepresence
A Pioneer Speaks – A History & Future of TelepresenceA Pioneer Speaks – A History & Future of Telepresence
A Pioneer Speaks – A History & Future of Telepresence
 
Visualizing Scientific Data - LATAM Faculty Summit 2011
Visualizing Scientific Data - LATAM Faculty Summit 2011Visualizing Scientific Data - LATAM Faculty Summit 2011
Visualizing Scientific Data - LATAM Faculty Summit 2011
 
ATMOS 2013- SciTech Quiz
ATMOS 2013- SciTech QuizATMOS 2013- SciTech Quiz
ATMOS 2013- SciTech Quiz
 
Nanotechnology academic essay assignment - www.topgradepapers.com
Nanotechnology   academic essay assignment - www.topgradepapers.comNanotechnology   academic essay assignment - www.topgradepapers.com
Nanotechnology academic essay assignment - www.topgradepapers.com
 
SSoE InFocus, Spring 2005
SSoE InFocus, Spring 2005SSoE InFocus, Spring 2005
SSoE InFocus, Spring 2005
 
Making Molehills of Mountains
Making Molehills of MountainsMaking Molehills of Mountains
Making Molehills of Mountains
 
2015 10-7-11am-reproducible research
2015 10-7-11am-reproducible research2015 10-7-11am-reproducible research
2015 10-7-11am-reproducible research
 
Quiz-Samasya 2019 finals
Quiz-Samasya 2019 finalsQuiz-Samasya 2019 finals
Quiz-Samasya 2019 finals
 
From Research Objects to Reproducible Science Tales
From Research Objects to Reproducible Science TalesFrom Research Objects to Reproducible Science Tales
From Research Objects to Reproducible Science Tales
 
Unit 1,2,3,4
Unit 1,2,3,4Unit 1,2,3,4
Unit 1,2,3,4
 
2008—The Year of Global Telepresence
2008—The Year of Global Telepresence2008—The Year of Global Telepresence
2008—The Year of Global Telepresence
 
Cyberinfrastructure for Einstein's Equations and Beyond
Cyberinfrastructure for Einstein's Equations and BeyondCyberinfrastructure for Einstein's Equations and Beyond
Cyberinfrastructure for Einstein's Equations and Beyond
 
Geek Night 16.0 - Evolution of Programming Languages
Geek Night 16.0 - Evolution of Programming LanguagesGeek Night 16.0 - Evolution of Programming Languages
Geek Night 16.0 - Evolution of Programming Languages
 
GeekNight: Evolution of Programming Languages
GeekNight: Evolution of Programming LanguagesGeekNight: Evolution of Programming Languages
GeekNight: Evolution of Programming Languages
 
Book naturoids
Book naturoidsBook naturoids
Book naturoids
 
Taxonomies and Ontologies – The Yin and Yang of Knowledge Modelling
Taxonomies and Ontologies – The Yin and Yang of Knowledge ModellingTaxonomies and Ontologies – The Yin and Yang of Knowledge Modelling
Taxonomies and Ontologies – The Yin and Yang of Knowledge Modelling
 

Recently uploaded

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Recently uploaded (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Pineda krch cmb2011-slides

  • 1. Cycles in finite populations — A reproducible seminar in three acts Mario Pineda-Krch October 31, 2011 1
  • 2. Act 1: The ghost of Fermat (The what, why and how of reproducible research) Act 2: A tale of two cycles (Demonstrating the existence of quasi-cycles using reproducible research) Act 3: Cycles at the edge of existence (Emergence of quasi-cycles in strongly destabilized ecosystems) 2
  • 3. Act 1: The ghost of Fermat 3
  • 4. Irreproducible research Randall J. LeVeque (2006) “Scientific and mathematical journals are filled with pretty pictures these days of computational experiments that the reader has no hope of repeating. Even brilliant and well intentioned computational scientists often do a poor job of presenting their work in a reproducible manner. The methods are often very vaguely defined, and even if they are carefully defined they would normally have to be implemented from scratch by the reader in order to test them. Most modern algorithms are so complicated that there is little hope of doing this properly.” Pierre de Fermat (1637) “It is impossible to separate a cube into two cubes, or a fourth power into two fourth powers, or in general, any power higher than the second, into two like powers. I have discovered a truly marvellous proof of this, which this margin is too narrow to contain.” 4
  • 5. What really happened? Reproducible results = Reproducible research 5
  • 6. Reproducible research: It’s not the destination. It’s the journey. 6
  • 7. Reproducible research: The What LeVeque (2006): “The idea of reproducible research in scientific computing is to archive and make publicly available all of the codes used to create the figures or tables in a paper in such a way that the reader can download the codes and run them to reproduce the results.” Wikipedia: “Reproducibility is one of the main principles of the scientific method, and refers to the ability of a test or experiment to be accurately reproduced, or replicated, by someone else working independently.”
  • 8. Reproducible research: The Why American Physical Society “Science is the systematic enterprise of gathering knowledge about the universe and organizing and condensing that knowledge into testable laws and theories. The success and credibility of science are anchored in the willingness of scientists to: Expose their ideas and results to the independent testing and replication by others. This requires the open exchange of data, procedure and materials.” Reproducability = Transparency + Executability 8
  • 9. Journal article Reader 6 Processed data Raw data Computer simulations Computer code Author Algorithms ? 9
  • 10. Literate programming A paradigm for reproducible research in computational sciences “The idea is that you do not document programs (after the fact), but write documents that contain the programs.” — John Max Skaller
  • 11. Literate programming according to Donald Knuth Prose Weave Tangle Documentation Program 11
  • 12. Literate programming systems LP system Document formatting language Programming language Inventor(s) Year WEB TEX Pascal Knuth 1992 CWEB TEX C/C++/Java Knuth & Levy 1993 FWEB L TEX A C/C++/FORTRAN Krommes 1993 noweb TEX/L TEX/HTML/troff A agnostic Ramsey 1999 Sweave L TEX A R Leisch 2002 PyLit reStructuredText Python Milde 2005 Pweave L TEX/reST/Sphinx/Pandoc A Python Pastell 2010 12
  • 13. Literate programming according to R The evolution of the literate programming paradigm Prose Sweave Stangle Documentation Code 13
  • 14. What really happens Prose Sweave Stangle Sweave Documentation Code Execute Integrate Results 14
  • 15. This research is reproducible! These slides are prepared using Sweave. These slides are executable (look for ). The full project (source, code, results, etc.) will be available at http://pineda-krch.com. 15
  • 16. Implementing reproducible research Attach code to publish results is good..., executable manuscripts are better. Adopt a habit of reproducibility, i.e. make it routine and require it from others (students, postdocs, colleagues). Keep reproducibility in computational research to the same rigorous standard as reproducibility in mathematical proofs. Demand reproducibility in your role as journal editor and reviewer of manuscripts and grants applications.
  • 17. Act 2: A tale of two cycles 17
  • 18. Olaus Magnus (1555) Historia de Gentibus First known depiction of of population cycles in Olaus Magnus’ Historia de Gentibus Septentrionalibus (History of the Northern Peoples) (1555) shows lemmings falling from the sky with two weasels with lemmings in their mouths. 18
  • 19. Elton (1924) British Journal of Experimental Biology 19
  • 20. Kendall et al. (1998) Ecology Letters 20
  • 21. Fluctuating populations Lynx 60000 20000 0 1750 1800 1850 1900 Otter Years 10000 14000 18000 Population size 6000 1850 1860 1870 1880 1890 1900 1910 Wolverine Years 2500 1500 500 0 1750 1800 1850 1900
  • 22. Explaining complex population dynamics using simple models Classical Lotka-Volterra Exponential growth in prey, linear (Type 1) functional response in predator Structurally unstable, mainly of historical interest Lotka-Volterra Logistic growth in prey, linear (Type 1) functional response in predator Does not cycle Rosenzweig-MacArthur Logistic growth in prey, non-linear (Type 2) functional response in predator (i.e. satiation) Cycles
  • 23. Rosenzweig-MacArthur predator-prey model (RMPP) dN N = rN 1 − K − 1 +awN NP dt dP = c 1 +awN NP − gP dt 23
  • 24. The deterministic RMPP in R > ode.rmpp <- function(parms = stop('Missing parms!'), x0 = stop('Missing x0!'), tmax = stop('Missing tmax')){ det.rmpp=function(t, y, parms){ N=y[1] ; P=y[2] with(as.list(parms),{ dN = (b-d)*N*(1-N/K)-a/(1+w*N)*N*P dP = c*a/(1+w*N)*N*P-g*P out=c(dN, dP) list(out) }) } require(odesolve) time <- seq(0, tmax, by=1) pop <- c(N=x0[['N']]*0.75, P=x0[['P']]*1.25) res = as.data.frame(lsoda(pop, time, det.rmpp, parms)) return(ode.res = res) }
  • 25. The stochastic RMPP in R > ssa.rmpp <- function(parms = stop('Missing parms!'), x0 = stop('Missing x0!'), tmax = stop('Missing tmax')){ command <- paste('../src/ssa_rmpp ', parms[['b']], parms[['d']], parms[['K']], parms[['a']], parms[['w']], parms[['c']], parms[['g']], x0[['N']], x0[['P']], tmax, '>../results/out.txt') system(command) res <- as.data.frame(read.csv('../results/out.txt', skip=1, header=TRUE)) return(ssa.res = res) }
  • 26. Structure of simulation model rmpp.R ode.rmpp.R ssa.rmpp.R ssa_rmpp.c 26
  • 27. Run a simulation in the stable node region Set the parameters > alpha <- 0.5 > beta <- 1 > gamma <- 1.2 > alpha; beta; gamma [1] 0.5 [1] 1 [1] 1.2 Set equilibrium population size > eq <- 1000 Set the length and the number of simulations > tmax <- 10000 > n <- 1 27
  • 28. Run a simulation in the stable node region Run the simulation > fn.node <- rmpp(alpha, beta, gamma, tmax, eq, n) Data was saved in > fn.node [1] "../results/rmpp-alpha0.5-beta1-gamma1.2-eq1000-1.RData" Loading the data > load(fn.node) Looking at the contents of the data file > ls() [1] "alpha" "beta" "d.lynx" "d.otter" "d.wolverin [6] "eq" "fn" "fn.node" "gamma" "i" [11] "n" "ode.res" "ode.rmpp" "parms" "rmpp" [16] "ssa.res" "ssa.rmpp" "start.time" "tmax" "x0" 28
  • 29. Plot results > layout(matrix(c(1,2), ncol=2)) > ymax <- max(c(ode.res$N, ode.res$P, ssa.res$N, ssa.res$P)) > ymin <- min(c(ode.res$N, ode.res$P, ssa.res$N, ssa.res$P)) > plot(N~time, ode.res, type='l', lwd=3, col=rgb(0,1,0,.75), xlab="Time", ylab="Population size", xlim=c(0, 250), ylim=c(ymin, ymax), bty='n') > points(P~time, ode.res, type='l', lwd=3, col=rgb(1,0,0,.75)) > title('Deterministic') > plot(N~time, ssa.res, type='l', lwd=3, col=rgb(0,1,0,.75), xlab="Time", ylab="", xlim=c(0, 250), ylim=c(ymin, ymax), bty='n') > points(P~time, ssa.res, type='l', lwd=3, col=rgb(1,0,0,.75)) > title('Stochastic') Deterministic Stochastic 1400 1400 1200 1200 Population size 1000 1000 800 800 600 600 400 400 0 50 100 150 200 250 0 50 100 150 200 250 Time Time Figure: Time series for RMPP model in stable node region (α = 0.5, β = 1, γ = 1.2).
  • 30. Run a simulation in the limit cycle region Deterministic Stochastic 3000 3000 2000 2000 Population size 1000 1000 500 500 0 0 0 50 100 150 200 250 0 50 100 150 200 250 Time Time Figure: Time series for RMPP model in limit cycle region (α = 0.5, β = 1, γ = 3.5).
  • 31. Run a simulation in the stable focus region Deterministic Stochastic 1500 1500 Population size 1000 1000 500 500 0 50 100 150 200 250 0 50 100 150 200 250 Time Time Figure: Time series for RMPP model in stable focus region α = 0.5, β = 1, γ = 2.5).
  • 32. Detecting periodic fluctuations in simulated time series Node 1200 1000 800 600 100 150 200 250 300 350 Focus Years 1800 Population size 1400 1000 600 100 150 200 250 300 350 Limit cycle Years 2500 1500 0 500 100 150 200 250 300 350 32
  • 33. Autocorrelation Function (ACF) Detecting periodic fluctuations Node Focus Limit cycle 1.0 1.0 1.0 0.8 0.5 0.5 0.6 ACF 0.0 0.4 0.0 −0.5 0.2 −0.5 0.0 0 10 20 30 40 0 5 10 15 20 25 30 0 5 10 15 20 25 30 Lag √ Evidence of periodicity if ACF(T) > 2/ tm where T is the lag of the dominant frequency (first maximum), tm is the number of data points in the time series. 33
  • 34. Power spectra Detecting periodic fluctuations Node Focus Limit cycle 8 8 8 q q q q q q q qq q qqq qq qq q q qq q qq q q 6 6 6 q qq q qq q qq q qq q qq q qq q qq qq qq qq qq qq qqq qqq qq q q qq q q q q qq q q q qq q q qq qqq q qq q q q qq q q q q q q qq q qqqqq q q qq q qq q q q q qq q qq qq q q q qq qq q q q q qq q qq q q qq q log10(Power) qq q q qq q q qq q q q q qq q q q qq q qqq q q q q q q qq qq qqqq q qqq q q q qq q q q q q q qqq qqqqq q q q q q q q q q q q qq q qq q qq q q q q qqq qqq qq qqq qqqqq q qq qqq q qq q q q q q qq qq qqq q q q q q q q q qqq q q q q q qq qq qq qq qq q qq qqq q q qq q q q q q q q qqqqqqqq qq q q q q q q q qq qqqq qqqq qqqq q qqq q q q qq qq q q qqq qq qqqq q qqqq q qqqq qq q q q qqqqqq q q qqqqqq q qqq qq q q q q q qqqqqqq qq q q q q qqqqqqqq q qq q q qq q q q q q qqqqqqqqqqqqqqqqqq q q q qqqqq qqqqqqqqqq q q q qq q q q q q qq q q qq qq q q q qq q qq qqq qqq q q q qqq qq qqqqqq qqqq q qq qq q q q q q q qqq qqqqqqqq q q q q qqqqqqqqqqqqqqq qq qqq q q qqqqqqqqqqqqqqqqqqq q qq q qqqqqqq qqqqqqqqqq qq qqqqqqq qq q q qq q q qq q qq qqq q qqqqqqq q q q qqqqq q q q qq q q q qqqqqqqq q qqqqqqqqqqqqqqqq q q q qqqq qqq qqqqqq q qq 4 4 4 q q qq q q qq q q q q qqqqqqq q qqqqq q q q qqqqqqqqq qqqqqqqqqqqqqqqq q qqq qqqqqqqqq q q q qqqqq qqqqqqqqqqq qqq qqqqqqqqqqqqqqqqqqq q qq qq qqqqqqqqqqqq qqqq qqqqqq q q q q qq q qq qq q qq qq q qqq qqqq q qq q q q qqq q qqqq qq q q qqqqqqqqqqqqqqqqqq q q q qqqqq q q q qq qq q q qq qqqqqqqqqqqqq qqq qqq qqqqqqqqqqqqqq qqq qqqqqqqqqqqq q qqqqqqqqqqqq q q q qqqqqqqqqqqqqqqq q q q q q qq q q q q q qqq qq qqqqq q qqqq qqqqqqq q qqqqq q qq q q q q q q qqq qq q qq qqqqq q qq q q q qqqq qqqqqqqqqqqqqqqqqqq qqqq q qqqqqqqqqqq qqqqqqqqqqqqqq q qq qqqqqqqqqqqqqq q qqqqqqqqqqqqqq q q q q q qqqqq qq q q qqqqq q q qqq q q q qq q qq qqqq q q qqqqqqqqqq qq qqqqq q qqqqqqq q q qqq qq qqqqqqqqqqqqqq q qqqqqqqqqq q q qqqqqqqqqqqqqq q q qqqq q q qq qqqqqq q qqqqqqq qq qq q qq qq q qq q qq qq qqqqq q q qqqqq q q q q qqqqqqq qq qqqqq q q qq qqqqqqqqqqq q q q qq qqqqqqqqqqqqqqq q qq qqqqqqqqqqq q qqqqqqq q qq q q qqq qqqqqqqqqqqqqq q qqqqqqqqqq q q qqqqqqqqqqqqqq qqqqqqq q q qq q q q qq q qqqqqqqqqqqqqq qqqq qqqqqqqq qq q qq qq qq q qq qqqq q q q qqq q qq qqq qq q q qq q qqqqqqqqqqqqqqqqqqqqqqqqqqq q qqqqqqqq qqqqq q qqqqqqqqqq qqqqqqqqq qqqq q qqqqqqq q qq qq q q qqqq q qqq q qq q qqq qqq q qqq q qqqq q q qqqqq qq qqqqqqqqqqqqqqq qq q qqqqqqqqqqq q q qqqqqqqqqq qq qq qqqqqqqqqqqqqqq qqqq qqqqqqqq qqqqqqqq q q q qq q qq q q q qqqqq qqqqqqqqqqq q q qqqqq q qqqqqqqqqqq q qq qqqqqq q qq q q qqqqq q q qqqq q qqqqqqqqqq q qqq qqqqqqqqq q q qqq q q q q q qq qq qq qq qq qq qq q qq qqqq q qq q qq qqq q qq qqqqqqqqqqqq q qqqqqqqqq q qq qqqq q qq q qqqqqqqqqqqqq q q q qq qqqqqqqqq qqq qqq q q q q q qq q qq q qq q q qq q qq q q q q q qqqqqqqqqqqqqq qqqqqq qqqqqq qqqqq qqqqqqq q qqqqqqqqqq qqqqqqqqq qqqqq q qqqqqqqqqq qqqqqq qq qqqqqqq q qq qqq qqq qq qq q q qqqq qqq q q q qqqqqqqqqq q q qq qqqqqq q q q qqqqq q qqqq qqqqqq qq qqqqq qq q q qqqqqqqq q q q q q qqqq qqq q qqqq qqqqqq qqqqqqqq q qqqqqqq q q qqqqqqq q q q qqqqqq qqq q q q qqq q qqq q q qqq qq qq qq qq q qq q qq q qq qqqqq q qqqqqq qqq q qqqq qq qqqq qq qqqqqq q q qq qq q q qq qq qqqq qq qq qqqqqqqq q q qq q qqq q qqqqq q qq q q qqqqqqq q qq qq qq q q q q q qqq q q q q qqqq q q qqqqqqq qqq q q qqq q q qqq q q q q qqqqqq q q qqqqqq qq q qq q 2 2 2 q qqqqq q q qqq qqqq q qqqqq qq qq q q q q q qq qqqq q qqq qq q q qq qq q qqq q q q qqq q q qqq q q q qqqq qq q qq qq q qq qq q qq q qq q qqq qqq qq q q q q q qq q qq q q q qq q q 0 0 0 q −4 −3 −2 −1 −3.0 −2.5 −2.0 −1.5 −1.0 −0.5 −3.0 −2.5 −2.0 −1.5 −1.0 −0.5 log10(Cycle frequency) Evidence of periodicity: presence of dominant frequency peak 34
  • 35. Marginal distribution Distinguishing between quasi-cycles and noisy limit cycles Node Focus Limit cycle 150 3000 200 2500 150 100 2000 Frequency 1500 100 1000 50 50 500 0 0 0 600 800 1000 1200 600 1000 1400 1800 0 500 1500 2500 Prey population size Evidence of limit cycle: bimodal distribution 35