Skip to content

Commit bf829e0

Browse files
committed
Fix up documentation for Tracy-Widom
1 parent c591d3d commit bf829e0

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

src/densities/TracyWidom.jl

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,28 @@ export TracyWidom
22

33
include("gradient.jl")
44

5+
"""
6+
Tracy-Widom distribution
7+
8+
The probability distribution of the normalized largest eigenvalue of a random
9+
Hermitian matrix.
10+
11+
References:
12+
13+
1. doi:10.1016/0370-2693(93)91114-3
14+
2. doi:10.1007/BF02100489
15+
16+
Numerical routines adapted from Alan Edelman's course notes for MIT 18.338,
17+
Random Matrix Theory, 2016.
18+
"""
519
immutable TracyWidom <: ContinuousUnivariateDistribution end
620

721

822
"""
23+
Probability density function of the Tracy-Widom distribution
24+
925
Computes the Tracy-Widom distribution by directly solving the
10-
Painlevé II equation by numerical integration
26+
Painlevé II equation using the ode23 numerical integrator
1127
"""
1228
function pdf{S<:Real}(d::TracyWidom, t::S, t0::S = convert(S, -8.0))
1329
tt0 && return 0.0
@@ -21,8 +37,10 @@ end
2137
pdf(d::Type{TracyWidom}, t::Real) = pdf(d(), t)
2238

2339
"""
40+
Cumulative density function of the Tracy-Widom distribution
41+
2442
Computes the Tracy-Widom distribution by directly solving the
25-
Painlevé II equation by numerical integration
43+
Painlevé II equation using the ode23 numerical integrator
2644
"""
2745
function cdf{S<:Real}(d::TracyWidom, t::S, t0::S = convert(S, -8.0))
2846
tt0 && return 0.0
@@ -34,6 +52,8 @@ function cdf{S<:Real}(d::TracyWidom, t::S, t0::S = convert(S, -8.0))
3452
end
3553
cdf(d::Type{TracyWidom}, t::Real) = cdf(d(), t)
3654

55+
# An internal function which sets up the Painleve II differential equation and
56+
# runs it through the ode23 numerical integrator
3757
function _solve_painleve_ii{S<:Real}(t0::S, t::S)
3858
deq(t, y) = [y[2], t*y[1]+2y[1]^3, y[4], y[1]^2]
3959
a0 = airy(t0)
@@ -43,7 +63,7 @@ function _solve_painleve_ii{S<:Real}(t0::S, t::S)
4363
end
4464

4565
"""
46-
Samples the largest eigenvalue of the n x n GUE matrix
66+
Samples the largest eigenvalue of the n × n GUE matrix
4767
"""
4868
function rand(d::TracyWidom, n::Integer)
4969
n > 1 || error("Cannot construct $n × $n matrix")

0 commit comments

Comments
 (0)