Examples » Walker: Integrating the generalized Dirichlet SDE

This example runs Walker to integrate the generalized Dirichlet SDE (see DiffEq/GeneralizedDirichlet.h) using constant coefficients. For more details on the generalized Dirichlet SDE, see https://doi.org/10.1063/1.4822416.

Control file

This example runs the setup that was used in the paper Bakosi, Ristorcelli, A Stochastic Diffusion Process for Lochner's generalized Dirichlet distribution, J. Math. Phys., 2013.

title "Generalized Dirichlet for the JMP paper"

walker
  term  140.0   # Max time
  dt    0.025   # Time step size
  npar  10000   # Number of particles
  ttyi  1000    # TTY output interval

  rngs
    mkl_mrg32k3a seed 0 end
  end

  gendir        # Select generalized Dirichlet SDE
    depvar y
    init zero
    coeff const
    ncomp 2   # = K = N-1
    b     0.1    1.5 end
    S     0.625  0.4 end
    kappa 0.0125 0.3 end
    c     -0.0125    end
    rng mkl_mrg32k3a    
  end

  statistics    # Estimate statistics
    <Y1>
    <Y2>
    <y1y1>
    <y2y2>
    <y1y2>
  end
end

Example run on a single CPU

Main/walker -v -c ../../tmp/gd.q

Results

This is case 2 in the paper referenced above. Left – time evolution of the means and the means of the invariant distribution, right – time evolution of the components of the covariance matrix and those of the invariant.

Image
Image

Gnuplot commands to reproduce the above plots:

plot "stat.txt" u 2:3 w l t "<Y1>", "stat.txt" u 2:4 w l t "<Y2>", 5.0/12.0 lt 1, 7.0/30.0 lt 2
plot "stat.txt" u 2:5 w l t "<y1y1>", "stat.txt" u 2:6 w l t "<y1y2>", "stat.txt" u 2:7 w l t "<y2y2>", 35.0/1872.0 lt 1, -35.0/4680 lt 2, 609.0/35100.0 lt 3