represents a Tracy–Widom distribution with Dyson index β.
TracyWidomDistribution
represents a Tracy–Widom distribution with Dyson index β.
Details
- The Tracy–Widom distribution is the limiting probability distribution of the normalized largest eigenvalue of a random matrix that belongs to a Gaussian ensemble.
- TracyWidomDistribution allows the Dyson index β to be 1, 2, or 4 according to the underlying matrix distribution:
-

GaussianOrthogonalMatrixDistribution β2 GaussianUnitaryMatrixDistribution β4 GaussianSymplecticMatrixDistribution - TracyWidomDistribution can be used with such functions as Mean, CDF, and RandomVariate.
Examples
open all close allBasic Examples (4)
Plot[Table[PDF[TracyWidomDistribution[β], x], {β, {1, 2, 4}}]//Evaluate, {x, -5, 2}, Filling -> Axis, PlotLegends -> {"β = 1", "β = 2", "β = 4"}]Cumulative distribution function:
Plot[Table[CDF[TracyWidomDistribution[β], x], {β, {1, 2, 4}}]//Evaluate, {x, -5, 2}, Filling -> Axis, PlotLegends -> {"β = 1", "β = 2", "β = 4"}]N[Table[Mean[TracyWidomDistribution[β]], {β, {1, 2, 4}}]]N[Table[Variance[TracyWidomDistribution[β]], {β, {1, 2, 4}}]]N[Table[Median[TracyWidomDistribution[β]], {β, {1, 2, 4}}]]Scope (4)
Generate a sample of pseudorandom numbers from a Tracy–Widom distribution:
data = RandomVariate[TracyWidomDistribution[2], 10 ^ 4];Compare its histogram to the PDF:
Show[
Histogram[data, {0.2}, PDF],
Plot[PDF[TracyWidomDistribution[2], x], {x, -5, 2}, PlotStyle -> Thick]]Moments of Tracy–Widom distributions are not available in closed form:
skewness = Table[Skewness[TracyWidomDistribution[beta]], {beta, {1, 2, 4}}]kurtosis = Table[Kurtosis[TracyWidomDistribution[beta]], {beta, {1, 2, 4}}]Find their machine‐precision approximation:
N[skewness]N[kurtosis]Compute the Mean of Tracy–Widom distribution to 50‐digit precision:
N[Mean[TracyWidomDistribution[2]], 50]Plot[Table[HazardFunction[TracyWidomDistribution[β], x], {β, {1, 2, 4}}]//Evaluate, {x, -5, 2}, Filling -> Axis, PlotLegends -> {"β = 1", "β = 2", "β = 4"}]Plot[Table[Quantile[TracyWidomDistribution[β], q], {β, {1, 2, 4}}]//Evaluate, {q, 0, 1}, Filling -> Axis, PlotLegends -> {"β = 1", "β = 2", "β = 4"}]Applications (4)
Use MatrixPropertyDistribution to represent the normalized largest eigenvalue of a matrix from Gaussian unitary ensemble:
ev𝒟[2, n_] := MatrixPropertyDistribution[(Max[Eigenvalues[x]] - 2Sqrt[n])n ^ (1 / 6), xGaussianUnitaryMatrixDistribution[n]]Sample from MatrixPropertyDistribution:
data2 = RandomVariate[ev𝒟[2, 250], 800];Compare the histogram with the PDF:
Show[Histogram[data2, {0.2}, PDF], Plot[PDF[TracyWidomDistribution[2], x ], {x, -5, 2}, PlotStyle -> Thick]]Perform similar computations with Gaussian orthogonal ensemble and Gaussian symplectic ensemble:
ev𝒟[1, n_] := MatrixPropertyDistribution[(Max[Eigenvalues[x]] - Sqrt[2n])Sqrt[2]n ^ (1 / 6), xGaussianOrthogonalMatrixDistribution[n]]ev𝒟[4, n_] := MatrixPropertyDistribution[(Max[Eigenvalues[x]] - 2Sqrt[2n])(n / 4) ^ (1 / 6), xGaussianSymplecticMatrixDistribution[n]]data1 = RandomVariate[ev𝒟[1, 250], 800];
data4 = RandomVariate[ev𝒟[4, 250], 800];Compare the histograms with the PDFs:
Show[Histogram[data1, {0.2}, PDF], Plot[PDF[TracyWidomDistribution[1], x ], {x, -5, 3}, PlotStyle -> Thick]]Show[Histogram[data4, {0.2}, PDF], Plot[PDF[TracyWidomDistribution[4], x ], {x, -5, 1}, PlotStyle -> Thick]]When n and p (the dimension of the covariance matrix Σ) are both large, the scaled largest eigenvalue of a matrix from Wishart ensemble with identity covariance is approximately distributed as Tracy–Widom distribution of
:
scev𝒟[n_, p_] := MatrixPropertyDistribution[(Max[Eigenvalues[x]] - (Sqrt[n - 1 / 2] + Sqrt[p - 1 / 2])^2) / ((Sqrt[n] + Sqrt[p])((1/Sqrt[n - 1 / 2]) + (1/Sqrt[p - 1 / 2]))^1 / 3), xWishartMatrixDistribution[n, IdentityMatrix[p]]]Sample the scaled largest eigenvalue:
data = RandomVariate[scev𝒟[1000, 100], 10 ^ 4];Compare the histogram of scaled largest eigenvalues with the PDF:
Show[Histogram[data, {0.2}, PDF], Plot[PDF[TracyWidomDistribution[1], x], {x, -5, 4}, PlotStyle -> Thick]]Compare the CDFs of Tracy–Widom distributions with the leading order asymptotic expansion on the left tail in log scale:
Subscript[F, β_][x_] := CDF[TracyWidomDistribution[β], x];logCDFapprox1[x_] = -(11Log[2]/48) + (1/24) - (1/2)Log[Glaisher] - (Abs[x]^3/24) - (Abs[x]^3 / 2/3Sqrt[2]) - (1/16)Log[Abs[x]];logCDFapprox2[x_] = (Log[2]/24) + (1/12) - Log[Glaisher] - (Abs[x]^3/12) - (1/8)Log[Abs[x]];logCDFapprox4[x_] = -(73 Log[2]/96) + (1/24) - (1/2)Log[Glaisher] - (Abs[x]^3/6Sqrt[2]) + (2^1 / 4Abs[x]^3 / 2/3) - (1/16)Log[Abs[x]];Show[Quiet@LogPlot[{Subscript[F, 1][x], Subscript[F, 2][x], Subscript[F, 4][x]}, {x, -18, -5}, Filling -> Axis, PlotLegends -> "Expressions"], Plot[{logCDFapprox1[x], logCDFapprox2[x], logCDFapprox4[x]}, {x, -18, -5}, PlotStyle -> Directive[Black, Dotted]]]Define a function to find the length of LongestOrderedSequence in the given sequence:
losLength[li_] := Length[LongestOrderedSequence[li]]Find lengths of the longest increasing subsequence in random permutations of list
:
n = 50000;
list = Range[n];
lengths = Table[losLength[RandomSample[list]], {2000}];Compare the scaled length of the longest increasing subsequence with Tracy–Widom distribution of
:
scaledLength = (1/n^1 / 6)(lengths - 2.0Sqrt[n]);Show[SmoothHistogram[scaledLength, PlotLegends -> {"Scaled length"}], Plot[PDF[TracyWidomDistribution[2], x], {x, -4, 2}, PlotStyle -> RGBColor[0.880722, 0.611041, 0.142051], PlotLegends -> {"Tracy-Widom distribution"}]]Properties & Relations (2)
CDFs of Tracy–Widom distributions for different values of β are related to each other:
Subscript[F, β_][x_] := CDF[TracyWidomDistribution[β], x];Plot[{Subscript[F, 4][x / Sqrt[2]], (1/2)(Subscript[F, 1][x] + Subscript[F, 2][x] / Subscript[F, 1][x])}, {x, -5, 2}, PlotStyle -> {Thickness[.025], Dashed}, Filling -> Axis, PlotLegends -> "Expressions"]Tracy–Widom distributions can be well approximated by GammaDistribution in the central region:
gdist = GammaDistribution[k, s, 1, a];
PDF[gdist, x]Match GammaDistribution with Tracy–Widom distribution of
with the first three moments:
moments = Comap[{Mean, Variance, Skewness}, gdist];
nmoments = N[Comap[{Mean, Variance, Skewness}, TracyWidomDistribution[2]]];
sol = FindRoot[Thread[moments == nmoments], {{k, 1}, {s, 1}, {a, 1}}]Plot[{PDF[gdist /. sol, x], PDF[TracyWidomDistribution[2], x]}//Evaluate, {x, -5, 2}, PlotLegends -> {"Gamma distribution", "Tracy-Widom distribution"}]Compare the CDFs between
in log scale:
LogPlot[{CDF[gdist /. sol, x], CDF[TracyWidomDistribution[2], x]}//Evaluate, {x, a + 1 /. sol, -5}, PlotLegends -> {"Gamma distribution", "Tracy-Widom distribution"}]Related Guides
History
Text
Wolfram Research (2015), TracyWidomDistribution, Wolfram Language function, https://reference.wolfram.com/language/ref/TracyWidomDistribution.html.
CMS
Wolfram Language. 2015. "TracyWidomDistribution." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TracyWidomDistribution.html.
APA
Wolfram Language. (2015). TracyWidomDistribution. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TracyWidomDistribution.html
BibTeX
@misc{reference.wolfram_2026_tracywidomdistribution, author="Wolfram Research", title="{TracyWidomDistribution}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/TracyWidomDistribution.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_tracywidomdistribution, organization={Wolfram Research}, title={TracyWidomDistribution}, year={2015}, url={https://reference.wolfram.com/language/ref/TracyWidomDistribution.html}, note=[Accessed: 13-June-2026]}