dummy-link

MaximalCouplings

Maximal coupling of two distribution in julia

Readme

MaximalCouplings

Build Status

Coverage Status

codecov.io

Julia package for maximal couplings between two probability distributions. The package mainly implements an algorithm for obtaining random draws from a maximal coupling, as described in Hermann Þórisson's book [1] and in Pierre Jacob's blog post.

Example

using Distributions
using MaximalCouplings

# create the maximal coupling object
c = MaximalCoupling(Normal(1,2), 
                    Gamma(1, 2))

# obtain 100,000 random draws from the coupling
xy_pairs = rand(c, 100000)
println("Fraction of samples where X==Y: ", mean(xy_pairs[1,:] .== xy_pairs[2,:]))

Fraction of samples where X==Y: 0.68141

p = prob_couple(c)
println("Probability of coupling: ", p)

Probability of coupling: 0.6812677887974173

References

  1. Þórisson, H., 2000. Coupling, stationarity, and regeneration (Vol. 14). New York: Springer.

First Commit

10/10/2017

Last Touched

about 2 years ago

Commits

25 commits

Used By: