SlideShare une entreprise Scribd logo
1  sur  102
Simulation: an ubiquitous tool for statistical computation




                Simulation: an ubiquitous tool for statistical
                               computation

                                                Christian P. Robert

                                    Universit´ Paris-Dauphine, IUF, & CREST
                                             e
                                   http://www.ceremade.dauphine.fr/~xian


                                                      July 9, 2012
Simulation: an ubiquitous tool for statistical computation




Outline
Simulation, what’s that for?!

Producing randomness by deterministic means

Monte Carlo principles

Simulated annealing
Simulation: an ubiquitous tool for statistical computation
  Simulation, what’s that for?!




Illustrations
       Necessity to “(re)produce chance” on a computer
               Evaluation of the behaviour of a complex system (network,
               computer program, queue, particle system, atmosphere,
               epidemics, economic actions, &tc)




                                                             [ c Office of Oceanic and Atmospheric Research]
Simulation: an ubiquitous tool for statistical computation
  Simulation, what’s that for?!




Illustrations
       Necessity to “(re)produce chance” on a computer
               Production of changing landscapes, characters, behaviours in
               computer games and flight simulators




                                                                 [ c guides.ign.com]
Simulation: an ubiquitous tool for statistical computation
  Simulation, what’s that for?!




Illustrations

       Necessity to “(re)produce chance” on a computer
               Determine probabilistic properties of a new statistical
               procedure or under an unknown distribution [bootstrap]




               (left) Estimation of the cdf F from a normal sample of 100 points;

               (right) variation of this estimation over 200 normal samples
Simulation: an ubiquitous tool for statistical computation
  Simulation, what’s that for?!




Illustrations

       Necessity to “(re)produce chance” on a computer
               Validation of a probabilistic model




               Histogram of 103 variates from a distribution and fit by this distribution density
Simulation: an ubiquitous tool for statistical computation
  Simulation, what’s that for?!




Illustrations

       Necessity to “(re)produce chance” on a computer
               Approximation of a integral




                                                             [ c my daughter’s math book]
Simulation: an ubiquitous tool for statistical computation
  Simulation, what’s that for?!




Illustrations

       Necessity to “(re)produce chance” on a computer
               Maximisation of a weakly regular function/likelihood




                                                             [ c Dan Rice Sudoku blog]
Simulation: an ubiquitous tool for statistical computation
  Simulation, what’s that for?!




Illustrations

       Necessity to “(re)produce chance” on a computer
               Pricing of a complex financial product (exotic options)




               Simulation of a Garch(1,1) process and of its volatility (103 time units)
Simulation: an ubiquitous tool for statistical computation
  Producing randomness by deterministic means




Pseudo-random generator

       Pivotal element/building block of simulation: always requires
       availability of uniform U (0, 1) random variables




                                                               [ c MMP World]
Simulation: an ubiquitous tool for statistical computation
  Producing randomness by deterministic means




Pseudo-random generator

       Pivotal element/building block of simulation: always requires
       availability of uniform U (0, 1) random variables
       0.1333139
       0.3026299
       0.4342966
       0.2395357
       0.3223723
       0.8531162
       0.3921457
       0.7625259
       0.1701947
       0.2816627
       .
       .
       .
Simulation: an ubiquitous tool for statistical computation
  Producing randomness by deterministic means




Pseudo-random generator


       Pivotal element/building block of simulation: always requires
       availability of uniform U (0, 1) random variables

       Definition (Pseudo-random generator)
       A pseudo-random generator is a deterministic function f from ]0, 1[
       to ]0, 1[ such that, for any starting value u0 and any n, the
       sequence
                          {u0 , f(u0 ), f(f(u0 )), . . . , f n (u0 )}
       behaves (statistically) like an iid U (0, 1) sequence
Simulation: an ubiquitous tool for statistical computation
  Producing randomness by deterministic means




Pseudo-random generator

       Pivotal element/building block of simulation: always requires
       availability of uniform U (0, 1) random variables
                                                        q




                                               0.8                        q


                                                                                                        q
                                               0.6
                                        xt+1




                                                                      q
                                               0.4




                                                            q




                                                                                                    q
                                               0.2




                                                                                    q


                                                                                                            q
                                                                                              q
                                               0.0




                                                      0.0       0.2           0.4       0.6       0.8




                                                     10 steps (ut , ut+1 ) of a uniform generator
Simulation: an ubiquitous tool for statistical computation
  Producing randomness by deterministic means




Philosophical foray

       ¡Paradox!
       While avoiding randomness, the deterministic sequence

                                    (u0 , u1 = f(u0 ), . . . , un = f(un−1 ))

       must resemble a random sequence!
       Debate on whether or not true
       randomness does exist (Laplace’s
       demon versus Schroedinger’s
       cat), in which case pseudo
       random generators are not
       random (von Neuman’s state of
       sin)
Simulation: an ubiquitous tool for statistical computation
  Producing randomness by deterministic means




Philosophical foray

       ¡Paradox!
       While avoiding randomness, the deterministic sequence

                                    (u0 , u1 = f(u0 ), . . . , un = f(un−1 ))

       must resemble a random sequence!
       Debate on whether or not true
       randomness does exist (Laplace’s
       demon versus Schroedinger’s
       cat), in which case pseudo
       random generators are not
       random (von Neuman’s state of
       sin)
Simulation: an ubiquitous tool for statistical computation
  Producing randomness by deterministic means




Philosophical foray
       ¡Paradox!
       While avoiding randomness, the deterministic sequence

                                    (u0 , u1 = f(u0 ), . . . , un = f(un−1 ))

       must resemble a random sequence!

       Debate on whether or not true
       randomness does exist (Laplace’s
       demon versus Schroedinger’s
       cat), in which case pseudo
       random generators are not
       random (von Neuman’s state of
       sin)
Simulation: an ubiquitous tool for statistical computation
  Producing randomness by deterministic means




Philosophical foray

       ¡Paradox!
       While avoiding randomness, the deterministic sequence

                                    (u0 , u1 = f(u0 ), . . . , un = f(un−1 ))

       must resemble a random sequence!
       Debate on whether or not true
       randomness does exist (Laplace’s
       demon versus Schroedinger’s
       cat), in which case pseudo
       random generators are not
       random (von Neuman’s state of
       sin)
Simulation: an ubiquitous tool for statistical computation
  Producing randomness by deterministic means




True random generators



                                   Intel circuit producing “truly random” numbers:
                                  There is no reason physical generators should be
                                  “more” random than congruential (deterministic)
                                  pseudo-random generators, as those are valid
                                  generators, i.e. their distribution is exactly known
                                  (e.g., uniform) and, in the case of parallel
                                  generations, completely independent
Simulation: an ubiquitous tool for statistical computation
  Producing randomness by deterministic means




True random generators



                                  Intel generator satisfies all benchmarks of
                                  “randomness” maintained by NIST:
                                  Skepticism about physical devices, when compared
                                  with mathematical functions, because of (a)
                                  non-reproducibility and (b) instability of the device,
                                  which means that proven uniformity at time t does
                                  not induce uniformity at time t + 1
Simulation: an ubiquitous tool for statistical computation
  Producing randomness by deterministic means




A standard uniform generator



       The congruencial generator on {1, 2, . . . , M}

                                           f(x) = (ax + b) mod (M)

       has a period equal to M for proper choices of (a, b) and becomes a
       generator on ]0, 1[ when dividing by M + 1
Simulation: an ubiquitous tool for statistical computation
  Producing randomness by deterministic means




A standard uniform generator
       The congruencial generator on {1, 2, . . . , M}

                                           f(x) = (ax + b) mod (M)

       has a period equal to M for proper choices of (a, b) and becomes a
       generator on ]0, 1[ when dividing by M + 1

       Example
       Take
                               f(x) = (69069069x + 12345) mod (232 )
       and produce
       ... 518974515 2498053016 1113825472 1109377984 ...
       i.e.
       ... 0.1208332 0.5816233 0.2593327 0.2582972 ...
Simulation: an ubiquitous tool for statistical computation
  Producing randomness by deterministic means




A standard uniform generator
       The congruencial generator on {1, 2, . . . , M}

                                           f(x) = (ax + b) mod (M)

       has a period equal to M for proper choices of (a, b) and becomes a
       generator on ]0, 1[ when dividing by M + 1
Simulation: an ubiquitous tool for statistical computation
  Producing randomness by deterministic means




A standard uniform generator
       The congruencial generator on {1, 2, . . . , M}

                                           f(x) = (ax + b) mod (M)

       has a period equal to M for proper choices of (a, b) and becomes a
       generator on ]0, 1[ when dividing by M + 1
Simulation: an ubiquitous tool for statistical computation
  Producing randomness by deterministic means




Approximating π

   My daughter’s pseudo-code:
    N=1000
    π=0
    ˆ
    for I=1,N do
       X=RDN(1), Y=RDN(1)
       if X2 + Y2 < 1 then
          π = π+1
          ˆ   ˆ
       end if
    end for
    return 4*ˆ /N
               π
Simulation: an ubiquitous tool for statistical computation
  Producing randomness by deterministic means




Approximating π
                                                                                                                                   pi = 3.2

                                                                                   q
                                                                 q
                                                                                                                                                             q                                    q


   My daughter’s pseudo-code:                                         q
                                                                         q
                                                                                 q q
                                                                                               q
                                                                                                               q

                                                                                                                           q
                                                                                                                                        q
                                                                                                                                                    q
                                                                                                                                                                              q
                                                                     q q
                                                                                                                                                                                                      q

    N=1000                                                   q                                             q
                                                                                                               q
                                                                                                               q
                                                                                                                               q
                                                                                                                               q

                                                                                                                                             q       q
                                                                                                                                                        q
                                                                                                                                                                 qq
                                                                                                                                                                              q


                                                                                                                                                                                  q
                                                                                                                                                         q

    π=0
    ˆ
                                                                                                                                                                                              q
                                                                                                                                        q
                                                                                                                       q                q
                                                                     q            q                                q
                                                                                                                       qq                                                                                     q
                                                                             q                             q                                                                                      q
                                                                                                                                            q       q

    for I=1,N do                                                             q
                                                                                   q
                                                                                                                       q
                                                                                                                                             q
                                                                                                                                                        q                 q           q

                                                                                                                                                                                                          q


       X=RDN(1), Y=RDN(1)                                                q
                                                                                           q
                                                                                               q
                                                                                                       q

                                                                                                                   q
                                                                                                                               q

                                                                                                                                    q
                                                                                                                                                     q       q                q




       if X2 + Y2 < 1 then
                                                             q                                                                     q        q                                             q                           q
                                                                                                   q                                            qq
                                                                             q
                                                                                                                                                 q                                        q
                                                                                                                       q
                                                                                                               q               q                        q

          π = π+1
          ˆ   ˆ                                              q       q


                                                                                   q
                                                                                                               q
                                                                                                                                                q q

                                                                                                                                                q
                                                                                                                                                                 q
                                                                                                                                                                                      q


                                                                                                                                        qq

       end if                                                                     q
                                                                                       q
                                                                                                                   q
                                                                                                                                                         q


                                                                                                                                                                                              q
                                                                                                                                                                                                  q

                                                                                                                                                                                                                  q
                                                                                                       q                                                              q                                   q


    end for
    return 4*ˆ /N
               π
                                                                                                               100 simulations
Simulation: an ubiquitous tool for statistical computation
  Producing randomness by deterministic means




Approximating π
                                                                                                            pi = 3.108

                                                             q
                                                             q                      q     q q            q q             q      qq                       q q
                                                                                                                                                         qq             q
                                                                   q                     qq            q                                                       q               q
                                                                    q        q              q q                            q               q            q      q       q
                                                                            q                                                                 qq q             qq            q
                                                                     q                                      q                           q       q q qq
                                                                                                                                                q       q
                                                                                                                                                                  q qq q  q

   My daughter’s pseudo-code:                                 q q q q
                                                                 q
                                                                 q
                                                                qq q
                                                                         q
                                                                            q
                                                                               q
                                                                             q q
                                                                               q      qq
                                                                                      qq
                                                                                         q
                                                                                       q q
                                                                                         q
                                                                                         q
                                                                                          q
                                                                                          q
                                                                                            q      q
                                                                                                   q
                                                                                                    q
                                                                                                        q
                                                                                                           q q
                                                                                                                     qq q
                                                                                                                     q
                                                                                                                 q q q
                                                                                                                     q
                                                                                                                    qq
                                                                                                                      q
                                                                                                                      q
                                                                                                                           qq


                                                                                                                              q q
                                                                                                                                  q q

                                                                                                                                  q
                                                                                                                                     q

                                                                                                                                             q
                                                                                                                                             q
                                                                                                                                               q
                                                                                                                                                  q qq q
                                                                                                                                                  q     qq
                                                                                                                                                  q q qqq q
                                                                                                                                                              q  q q q
                                                                                                                                                                 q
                                                                                                                                                                     q
                                                                                                                                                                       q q
                                                                                                                                                                              qq
                                                                                                                                                                               q
                                                                                                                                                                               q
                                                                   q                     q                q q                                q                       q       q
                                                                 qq           q q                 q        qq q                q q q qq q q
                                                                                                                             qq q
                                                                                                                                q               q
                                                                 q q
                                                                 q qq         qq
                                                                               q       q
                                                                                                    q q       q               q q

    N=1000                                                   q
                                                               q
                                                                q q qq
                                                                 q
                                                                 q q
                                                                       qq
                                                                        q
                                                                           q qq q q

                                                                               q
                                                                                     qq
                                                                                      q
                                                                                       q
                                                                                       q
                                                                                             q
                                                                                                  q
                                                                                             q q q q
                                                                                                    q q
                                                                                                    q
                                                                                                     q
                                                                                                            q
                                                                                                            q q
                                                                                                        q qq q q q
                                                                                                          q q
                                                                                                             q
                                                                                                              q
                                                                                                                     qq
                                                                                                                          q
                                                                                                                          q qq
                                                                                                                          q qq
                                                                                                                             q
                                                                                                                                    q


                                                                                                                                   qq q
                                                                                                                                       q q
                                                                                                                                          q
                                                                                                                                           q
                                                                                                                                           q


                                                                                                                                            qq
                                                                                                                                              qq

                                                                                                                                                     q
                                                                                                                                                      q

                                                                                                                                                      q q
                                                                                                                                                           q
                                                                                                                                                          qq
                                                                                                                                                           qq
                                                                                                                                                                q    q
                                                                                                                                                                   q q
                                                                                                                                                                   q
                                                                                                                                                                       q qq

                                                                                                                                                                       q q
                                                                                                                                                                        q
                                                                                                                                                                           q

                                                                                                                                                                            q q
                                                                                                                                                                              q
                                                                                                                                                                             q q
                                                                                                                                                                                 q
                                                                  q q         q                q
                                                                                               q                q                   qq       q qq qq qq q q                    q
                                                                 q                     q       q        qq                                                           q

    π=0
    ˆ                                                         q
                                                              q q
                                                               q
                                                                q
                                                                     q
                                                                      q
                                                                         q q qq
                                                                            qq

                                                                      q q qq q
                                                                               q
                                                                               q q
                                                                                q
                                                                                     q
                                                                                       q
                                                                                      q qq
                                                                                        q
                                                                                         qq q
                                                                                            q
                                                                                                q
                                                                                              q q
                                                                                                 q


                                                                                                      qq
                                                                                                        q
                                                                                                        q
                                                                                                          q
                                                                                                                 q q q

                                                                                                                 q
                                                                                                                    q
                                                                                                                    qqq
                                                                                                                       q
                                                                                                                          qq
                                                                                                                                qq

                                                                                                                                  q
                                                                                                                                   q q

                                                                                                                                     q
                                                                                                                                      q


                                                                                                                                      q
                                                                                                                                         q q
                                                                                                                                          q
                                                                                                                                           q q
                                                                                                                                               q
                                                                                                                                              qq
                                                                                                                                               q    q
                                                                                                                                                    q    q
                                                                                                                                                          q q
                                                                                                                                                                q
                                                                                                                                                               q q
                                                                                                                                                               qq
                                                                                                                                                                    q q
                                                                                                                                                                         q
                                                                                                                                                                             qq

                                                                                                                                                                               qq
                                                                                                                                                                               q
                                                                  q q q              q     q q                     q
                                                                                                                        q q qq
                                                                                                                              q                q q                    q qq
                                                                                           q                                                    q q q q qqq            q q

    for I=1,N do                                             q qq
                                                             q


                                                              qq
                                                                   q
                                                              q q qq
                                                                    q
                                                                           q

                                                                        qqqq
                                                                        q
                                                                           q
                                                                             q

                                                                              q
                                                                                q q
                                                                                     q
                                                                                  q q q q
                                                                                  q
                                                                                       q        q
                                                                                              qq q
                                                                                                q
                                                                                                   q


                                                                                                      q
                                                                                                         q
                                                                                                              q
                                                                                                               q
                                                                                                              qq q q q
                                                                                                                 qq
                                                                                                                   q
                                                                                                                    q
                                                                                                                      q    qq
                                                                                                                          qq q
                                                                                                                                q
                                                                                                                               q q
                                                                                                                                   qq
                                                                                                                                          q q
                                                                                                                                              q
                                                                                                                                                qq q

                                                                                                                                            qq q q
                                                                                                                                                      q
                                                                                                                                                       q
                                                                                                                                                        q qq q
                                                                                                                                                   qq q q q q q
                                                                                                                                                            q
                                                                                                                                                            q
                                                                                                                                                               qq q
                                                                                                                                                                    q
                                                                                                                                                                           q

                                                                                                                                                                                q
                                                                                                                                                                               qq
                                                                       qq
                                                                       q
                                                                     q q                qq q q
                                                                                                     qq qq       q        q
                                                                                                                            q         qq         q       q q q q qq
                                                                                                                                                                q              q
                                                                                                  q                                            q q q q
                                                                                                                                                q                  q

       X=RDN(1), Y=RDN(1)                                    q
                                                             q q q
                                                              q
                                                               q
                                                                 q    q
                                                                           q


                                                                           q q q
                                                                                qq

                                                                                q q        q q
                                                                                               q
                                                                                              q q
                                                                                                q
                                                                                                qq
                                                                                                  q q   q
                                                                                                         qq

                                                                                                          qq q
                                                                                                                q
                                                                                                                q
                                                                                                                 q
                                                                                                                    qq

                                                                                                                   qq q
                                                                                                                         q
                                                                                                                          q
                                                                                                                                 q
                                                                                                                              q q qq q
                                                                                                                                  qq
                                                                                                                                   q
                                                                                                                                     q
                                                                                                                                           q

                                                                                                                                 q qq qq q q q q q
                                                                                                                                      q qq
                                                                                                                                                  q qq
                                                                                                                                                             q


                                                                                                                                                                   q
                                                                                                                                                                     q
                                                                                                                                                                     qq
                                                                                                                                                                         q
                                                                                                                                                                            q
                                                                                                                                                                            qq
                                                                                                                                                                              q



                                                                                  q q q                                 q


       if X2 + Y2 < 1 then
                                                             q q                                        q                          qq q          q qq q                  q
                                                               q                                  q q         q
                                                                                                             q qq q                                q qq q q q             q
                                                                          q qq                  q             qqq q                         q                        q qq       q
                                                               q      q                      q      q qq qq q   q
                                                                                                                q        q q       q                       q
                                                             q            q           q
                                                                                  q q q
                                                                                                q q      q qq           q           q
                                                                                                                                q qq q
                                                                                                                                               qq q                 q
                                                                 q          q          q
                                                                                      q q q                    q q q q qq                 q       q
                                                                                                                                                 q qq                    qq q
                                                             q            q q   q
                                                                                                    qq        q                      q
                                                                                                                                     qqq q        q q       q               q q
                                                                                                                                                                           q q
                                                                q      q q qq q q   q               q q
                                                                                                                              q q qq                        q q
                                                                            q                       qq                                          q                      q
                                                                                                                                                                       q
                                                                                                                q q q
          π = π+1
          ˆ   ˆ                                                q
                                                               qq
                                                             q q q
                                                                 q q
                                                                    q
                                                                     q


                                                                       q
                                                                          qq
                                                                            q
                                                                            q
                                                                           qq
                                                                             q
                                                                                   q
                                                                                     q
                                                                                     q q
                                                                                      q
                                                                                     q qq
                                                                                       q q
                                                                                       q q
                                                                                            q     q q
                                                                                                   q
                                                                                                        q


                                                                                                       q qq
                                                                                                            q q qq
                                                                                                            q
                                                                                                             q q
                                                                                                             qq q
                                                                                                              q
                                                                                                                  qq q qq q q
                                                                                                                             q qq

                                                                                                                               q
                                                                                                                                q

                                                                                                                               q q
                                                                                                                                             q
                                                                                                                                          q qq q
                                                                                                                                            qq q
                                                                                                                                            qq
                                                                                                                                               q
                                                                                                                                                  q
                                                                                                                                                  q
                                                                                                                                                     q


                                                                                                                                                     q
                                                                                                                                                            q q q
                                                                                                                                                          qq q
                                                                                                                                                         qq q q
                                                                                                                                                  q q q qq
                                                                                                                                                                qq
                                                                                                                                                                      q

                                                                                                                                                                         q q
                                                                                                                                                                             q
                                                                                                                                                                        q qq q q
                                                                                                                                                                        q      qq
                                                                                                                                                                                q

                                                                                                                                                                       q q q
                                                                       qq          q q q              q
                                                                                                      q q          q q       q     q         qq     qq         q           qq

       end if
                                                                  q
                                                                qq           q                       q q
                                                                                                     q     q         q q
                                                                                                                      q             q               q q q  q    q qq
                                                                              q           q
                                                                                          q                  q       q qq
                                                                                                                      q                  qq                  q         q q
                                                                     q
                                                                             q           qq
                                                                                          q             q                         qq q qq   q          q     q     qq q q q
                                                                                           q       qq q            q                                                q
                                                                      qq q q q
                                                                           q                              q              q     q              q q
                                                                                   q              q
                                                                                              qq q q q q
                                                                                                               q          q         q               q
                                                                                                                                                qq q q    q       q qqq  q      q
                                                              q     qq                 q                                 q


    end for
    return 4*ˆ /N
               π
                                                                                               1000 simulations
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture
Simulation - public lecture

Contenu connexe

Plus de Deb Roy

Model complexity
Model complexityModel complexity
Model complexityDeb Roy
 
PhD Recipe
PhD RecipePhD Recipe
PhD RecipeDeb Roy
 
Slides2 130201091056-phpapp01
Slides2 130201091056-phpapp01Slides2 130201091056-phpapp01
Slides2 130201091056-phpapp01Deb Roy
 
Discussion cabras-robert-130323171455-phpapp02
Discussion cabras-robert-130323171455-phpapp02Discussion cabras-robert-130323171455-phpapp02
Discussion cabras-robert-130323171455-phpapp02Deb Roy
 
ABC & Empirical Lkd
ABC & Empirical LkdABC & Empirical Lkd
ABC & Empirical LkdDeb Roy
 
Mcmc & lkd free II
Mcmc & lkd free IIMcmc & lkd free II
Mcmc & lkd free IIDeb Roy
 
Mcmc & lkd free I
Mcmc & lkd free IMcmc & lkd free I
Mcmc & lkd free IDeb Roy
 
ABC-Xian
ABC-XianABC-Xian
ABC-XianDeb Roy
 
Vanilla rao blackwellisation
Vanilla rao blackwellisationVanilla rao blackwellisation
Vanilla rao blackwellisationDeb Roy
 
Xian's abc
Xian's abcXian's abc
Xian's abcDeb Roy
 

Plus de Deb Roy (11)

Model complexity
Model complexityModel complexity
Model complexity
 
PhD Recipe
PhD RecipePhD Recipe
PhD Recipe
 
DIC
DICDIC
DIC
 
Slides2 130201091056-phpapp01
Slides2 130201091056-phpapp01Slides2 130201091056-phpapp01
Slides2 130201091056-phpapp01
 
Discussion cabras-robert-130323171455-phpapp02
Discussion cabras-robert-130323171455-phpapp02Discussion cabras-robert-130323171455-phpapp02
Discussion cabras-robert-130323171455-phpapp02
 
ABC & Empirical Lkd
ABC & Empirical LkdABC & Empirical Lkd
ABC & Empirical Lkd
 
Mcmc & lkd free II
Mcmc & lkd free IIMcmc & lkd free II
Mcmc & lkd free II
 
Mcmc & lkd free I
Mcmc & lkd free IMcmc & lkd free I
Mcmc & lkd free I
 
ABC-Xian
ABC-XianABC-Xian
ABC-Xian
 
Vanilla rao blackwellisation
Vanilla rao blackwellisationVanilla rao blackwellisation
Vanilla rao blackwellisation
 
Xian's abc
Xian's abcXian's abc
Xian's abc
 

Dernier

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
🐬 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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
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
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Dernier (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Simulation - public lecture

  • 1. Simulation: an ubiquitous tool for statistical computation Simulation: an ubiquitous tool for statistical computation Christian P. Robert Universit´ Paris-Dauphine, IUF, & CREST e http://www.ceremade.dauphine.fr/~xian July 9, 2012
  • 2. Simulation: an ubiquitous tool for statistical computation Outline Simulation, what’s that for?! Producing randomness by deterministic means Monte Carlo principles Simulated annealing
  • 3. Simulation: an ubiquitous tool for statistical computation Simulation, what’s that for?! Illustrations Necessity to “(re)produce chance” on a computer Evaluation of the behaviour of a complex system (network, computer program, queue, particle system, atmosphere, epidemics, economic actions, &tc) [ c Office of Oceanic and Atmospheric Research]
  • 4. Simulation: an ubiquitous tool for statistical computation Simulation, what’s that for?! Illustrations Necessity to “(re)produce chance” on a computer Production of changing landscapes, characters, behaviours in computer games and flight simulators [ c guides.ign.com]
  • 5. Simulation: an ubiquitous tool for statistical computation Simulation, what’s that for?! Illustrations Necessity to “(re)produce chance” on a computer Determine probabilistic properties of a new statistical procedure or under an unknown distribution [bootstrap] (left) Estimation of the cdf F from a normal sample of 100 points; (right) variation of this estimation over 200 normal samples
  • 6. Simulation: an ubiquitous tool for statistical computation Simulation, what’s that for?! Illustrations Necessity to “(re)produce chance” on a computer Validation of a probabilistic model Histogram of 103 variates from a distribution and fit by this distribution density
  • 7. Simulation: an ubiquitous tool for statistical computation Simulation, what’s that for?! Illustrations Necessity to “(re)produce chance” on a computer Approximation of a integral [ c my daughter’s math book]
  • 8. Simulation: an ubiquitous tool for statistical computation Simulation, what’s that for?! Illustrations Necessity to “(re)produce chance” on a computer Maximisation of a weakly regular function/likelihood [ c Dan Rice Sudoku blog]
  • 9. Simulation: an ubiquitous tool for statistical computation Simulation, what’s that for?! Illustrations Necessity to “(re)produce chance” on a computer Pricing of a complex financial product (exotic options) Simulation of a Garch(1,1) process and of its volatility (103 time units)
  • 10. Simulation: an ubiquitous tool for statistical computation Producing randomness by deterministic means Pseudo-random generator Pivotal element/building block of simulation: always requires availability of uniform U (0, 1) random variables [ c MMP World]
  • 11. Simulation: an ubiquitous tool for statistical computation Producing randomness by deterministic means Pseudo-random generator Pivotal element/building block of simulation: always requires availability of uniform U (0, 1) random variables 0.1333139 0.3026299 0.4342966 0.2395357 0.3223723 0.8531162 0.3921457 0.7625259 0.1701947 0.2816627 . . .
  • 12. Simulation: an ubiquitous tool for statistical computation Producing randomness by deterministic means Pseudo-random generator Pivotal element/building block of simulation: always requires availability of uniform U (0, 1) random variables Definition (Pseudo-random generator) A pseudo-random generator is a deterministic function f from ]0, 1[ to ]0, 1[ such that, for any starting value u0 and any n, the sequence {u0 , f(u0 ), f(f(u0 )), . . . , f n (u0 )} behaves (statistically) like an iid U (0, 1) sequence
  • 13. Simulation: an ubiquitous tool for statistical computation Producing randomness by deterministic means Pseudo-random generator Pivotal element/building block of simulation: always requires availability of uniform U (0, 1) random variables q 0.8 q q 0.6 xt+1 q 0.4 q q 0.2 q q q 0.0 0.0 0.2 0.4 0.6 0.8 10 steps (ut , ut+1 ) of a uniform generator
  • 14. Simulation: an ubiquitous tool for statistical computation Producing randomness by deterministic means Philosophical foray ¡Paradox! While avoiding randomness, the deterministic sequence (u0 , u1 = f(u0 ), . . . , un = f(un−1 )) must resemble a random sequence! Debate on whether or not true randomness does exist (Laplace’s demon versus Schroedinger’s cat), in which case pseudo random generators are not random (von Neuman’s state of sin)
  • 15. Simulation: an ubiquitous tool for statistical computation Producing randomness by deterministic means Philosophical foray ¡Paradox! While avoiding randomness, the deterministic sequence (u0 , u1 = f(u0 ), . . . , un = f(un−1 )) must resemble a random sequence! Debate on whether or not true randomness does exist (Laplace’s demon versus Schroedinger’s cat), in which case pseudo random generators are not random (von Neuman’s state of sin)
  • 16. Simulation: an ubiquitous tool for statistical computation Producing randomness by deterministic means Philosophical foray ¡Paradox! While avoiding randomness, the deterministic sequence (u0 , u1 = f(u0 ), . . . , un = f(un−1 )) must resemble a random sequence! Debate on whether or not true randomness does exist (Laplace’s demon versus Schroedinger’s cat), in which case pseudo random generators are not random (von Neuman’s state of sin)
  • 17. Simulation: an ubiquitous tool for statistical computation Producing randomness by deterministic means Philosophical foray ¡Paradox! While avoiding randomness, the deterministic sequence (u0 , u1 = f(u0 ), . . . , un = f(un−1 )) must resemble a random sequence! Debate on whether or not true randomness does exist (Laplace’s demon versus Schroedinger’s cat), in which case pseudo random generators are not random (von Neuman’s state of sin)
  • 18. Simulation: an ubiquitous tool for statistical computation Producing randomness by deterministic means True random generators Intel circuit producing “truly random” numbers: There is no reason physical generators should be “more” random than congruential (deterministic) pseudo-random generators, as those are valid generators, i.e. their distribution is exactly known (e.g., uniform) and, in the case of parallel generations, completely independent
  • 19. Simulation: an ubiquitous tool for statistical computation Producing randomness by deterministic means True random generators Intel generator satisfies all benchmarks of “randomness” maintained by NIST: Skepticism about physical devices, when compared with mathematical functions, because of (a) non-reproducibility and (b) instability of the device, which means that proven uniformity at time t does not induce uniformity at time t + 1
  • 20. Simulation: an ubiquitous tool for statistical computation Producing randomness by deterministic means A standard uniform generator The congruencial generator on {1, 2, . . . , M} f(x) = (ax + b) mod (M) has a period equal to M for proper choices of (a, b) and becomes a generator on ]0, 1[ when dividing by M + 1
  • 21. Simulation: an ubiquitous tool for statistical computation Producing randomness by deterministic means A standard uniform generator The congruencial generator on {1, 2, . . . , M} f(x) = (ax + b) mod (M) has a period equal to M for proper choices of (a, b) and becomes a generator on ]0, 1[ when dividing by M + 1 Example Take f(x) = (69069069x + 12345) mod (232 ) and produce ... 518974515 2498053016 1113825472 1109377984 ... i.e. ... 0.1208332 0.5816233 0.2593327 0.2582972 ...
  • 22. Simulation: an ubiquitous tool for statistical computation Producing randomness by deterministic means A standard uniform generator The congruencial generator on {1, 2, . . . , M} f(x) = (ax + b) mod (M) has a period equal to M for proper choices of (a, b) and becomes a generator on ]0, 1[ when dividing by M + 1
  • 23. Simulation: an ubiquitous tool for statistical computation Producing randomness by deterministic means A standard uniform generator The congruencial generator on {1, 2, . . . , M} f(x) = (ax + b) mod (M) has a period equal to M for proper choices of (a, b) and becomes a generator on ]0, 1[ when dividing by M + 1
  • 24. Simulation: an ubiquitous tool for statistical computation Producing randomness by deterministic means Approximating π My daughter’s pseudo-code: N=1000 π=0 ˆ for I=1,N do X=RDN(1), Y=RDN(1) if X2 + Y2 < 1 then π = π+1 ˆ ˆ end if end for return 4*ˆ /N π
  • 25. Simulation: an ubiquitous tool for statistical computation Producing randomness by deterministic means Approximating π pi = 3.2 q q q q My daughter’s pseudo-code: q q q q q q q q q q q q q N=1000 q q q q q q q q q qq q q q π=0 ˆ q q q q q q q qq q q q q q q for I=1,N do q q q q q q q q X=RDN(1), Y=RDN(1) q q q q q q q q q q if X2 + Y2 < 1 then q q q q q q qq q q q q q q q π = π+1 ˆ ˆ q q q q q q q q q qq end if q q q q q q q q q q end for return 4*ˆ /N π 100 simulations
  • 26. Simulation: an ubiquitous tool for statistical computation Producing randomness by deterministic means Approximating π pi = 3.108 q q q q q q q q qq q q qq q q qq q q q q q q q q q q q q q qq q qq q q q q q q qq q q q qq q q My daughter’s pseudo-code: q q q q q q qq q q q q q q q qq qq q q q q q q q q q q q q q q qq q q q q q q qq q q qq q q q q q q q q q q qq q q qq q q qqq q q q q q q q q q qq q q q q q q q q q qq q q q qq q q q q qq q q qq q q q q q q qq qq q q q q q q q N=1000 q q q q qq q q q qq q q qq q q q qq q q q q q q q q q q q q q q q q q qq q q q q q q q qq q q qq q qq q q qq q q q q q q qq qq q q q q q qq qq q q q q q q qq q q q q q q q q q q q q q q q q qq q qq qq qq q q q q q q qq q π=0 ˆ q q q q q q q q q qq qq q q qq q q q q q q q q qq q qq q q q q q q qq q q q q q q q q qqq q qq qq q q q q q q q q q q q q qq q q q q q q q q q qq q q q qq qq q q q q q q q q q q qq q q q q qq q q q q q qqq q q for I=1,N do q qq q qq q q q qq q q qqqq q q q q q q q q q q q q q q qq q q q q q q q qq q q q qq q q q qq qq q q q q qq q q q qq q qq q q q q q qq q qq q q q q q q q qq q q q q qq qq q q q qq q q qq qq q q q qq q q q q q qq q q q q q q q q q X=RDN(1), Y=RDN(1) q q q q q q q q q q q q qq q q q q q q q q qq q q q qq qq q q q q qq qq q q q q q q qq q qq q q q q qq qq q q q q q q qq q qq q q q qq q q qq q q q q q if X2 + Y2 < 1 then q q q qq q q qq q q q q q q q qq q q qq q q q q q qq q qqq q q q qq q q q q q qq qq q q q q q q q q q q q q q q q q qq q q q qq q qq q q q q q q q q q q q q qq q q q qq qq q q q q q qq q q qqq q q q q q q q q q q q qq q q q q q q q qq q q q qq q q q q q q π = π+1 ˆ ˆ q qq q q q q q q q q qq q q qq q q q q q q q qq q q q q q q q q q q qq q q qq q q q qq q q qq q qq q q q qq q q q q q q qq q qq q qq q q q q q q q q qq q qq q q q q q qq qq q q q q q qq q q q qq q q q q qq q q q q q q q q q q qq qq q qq end if q qq q q q q q q q q q q q q q q qq q q q q q qq q qq q q q q q qq q q qq q qq q q q qq q q q q qq q q q qq q q q q q q q q q q q qq q q q q q q q q qq q q q q qqq q q q qq q q end for return 4*ˆ /N π 1000 simulations