@@ -2,12 +2,28 @@ export TracyWidom
2
2
3
3
include (" gradient.jl" )
4
4
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
+ """
5
19
immutable TracyWidom <: ContinuousUnivariateDistribution end
6
20
7
21
8
22
"""
23
+ Probability density function of the Tracy-Widom distribution
24
+
9
25
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
11
27
"""
12
28
function pdf {S<:Real} (d:: TracyWidom , t:: S , t0:: S = convert (S, - 8.0 ))
13
29
t≤ t0 && return 0.0
21
37
pdf (d:: Type{TracyWidom} , t:: Real ) = pdf (d (), t)
22
38
23
39
"""
40
+ Cumulative density function of the Tracy-Widom distribution
41
+
24
42
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
26
44
"""
27
45
function cdf {S<:Real} (d:: TracyWidom , t:: S , t0:: S = convert (S, - 8.0 ))
28
46
t≤ t0 && return 0.0
@@ -34,6 +52,8 @@ function cdf{S<:Real}(d::TracyWidom, t::S, t0::S = convert(S, -8.0))
34
52
end
35
53
cdf (d:: Type{TracyWidom} , t:: Real ) = cdf (d (), t)
36
54
55
+ # An internal function which sets up the Painleve II differential equation and
56
+ # runs it through the ode23 numerical integrator
37
57
function _solve_painleve_ii {S<:Real} (t0:: S , t:: S )
38
58
deq (t, y) = [y[2 ], t* y[1 ]+ 2 y[1 ]^ 3 , y[4 ], y[1 ]^ 2 ]
39
59
a0 = airy (t0)
@@ -43,7 +63,7 @@ function _solve_painleve_ii{S<:Real}(t0::S, t::S)
43
63
end
44
64
45
65
"""
46
- Samples the largest eigenvalue of the n x n GUE matrix
66
+ Samples the largest eigenvalue of the n × n GUE matrix
47
67
"""
48
68
function rand (d:: TracyWidom , n:: Integer )
49
69
n > 1 || error (" Cannot construct $n × $n matrix" )
0 commit comments