# Tracy–Widom distribution

The Tracy–Widom distribution is a probability distribution from random matrix theory introduced by Craig Tracy and Harold Widom (1993, 1994). It is the distribution of the normalized largest eigenvalue of a random Hermitian matrix. The distribution is defined as a Fredholm determinant.
In practical terms, Tracy–Widom is the crossover function between the two phases of weakly versus strongly coupled components in a system. It also appears in the distribution of the length of the longest increasing subsequence of random permutations, as large-scale statistics in the Kardar-Parisi-Zhang equation, in current fluctuations of the asymmetric simple exclusion process (ASEP) with step initial condition, and in simplified mathematical models of the behavior of the longest common subsequence problem on random inputs. See Takeuchi & Sano (2010) and Takeuchi et al. (2011) for experimental testing (and verifying) that the interface fluctuations of a growing droplet (or substrate) are described by the TW distribution $F_{2}$ (or $F_{1}$) as predicted by Prähofer & Spohn (2000).
The distribution $F_{1}$ is of particular interest in multivariate statistics. For a discussion of the universality of $F_{\beta }$, $\beta =1,2,4$, see Deift (2007). For an application of $F_{1}$ to inferring population structure from genetic data see Patterson, Price & Reich (2006). In 2017 it was proved that the distribution F is not infinitely divisible.

## Definition as a law of large numbers

Let $F_{\beta }$ denote the cumulative distribution function of the Tracy–Widom distribution with given $\beta$. It can be defined as a law of large numbers, similar to the central limit theorem.
There are typically three Tracy–Widom distributions, $F_{\beta }$, with $\beta \in \{1,2,4\}$. They correspond to the three gaussian ensembles: orthogonal ($\beta =1$), unitary ($\beta =2$), and symplectic ($\beta =4$).
In general, consider a gaussian ensemble with beta value $\beta$, with its diagonal entries having variance 1, and off-diagonal entries having variance $\sigma ^{2}$, and let $F_{N,\beta }(s)$ be probability that an $N\times N$ matrix sampled from the ensemble have maximal eigenvalue $\leq s$, then define$F_{\beta }(x)=\lim _{N\to \infty }F_{N,\beta }(\sigma (2N^{1/2}+N^{-1/6}x))=\lim _{N\to \infty }Pr(N^{1/6}(\lambda _{max}/\sigma -2N^{1/2})\leq x)$where $\lambda _{\max }$ denotes the largest eigenvalue of the random matrix. The shift by $2\sigma N^{1/2}$ centers the distribution, since at the limit, the eigenvalue distribution converges to the semicircular distribution with radius $2\sigma N^{1/2}$. The multiplication by $N^{1/6}$ is used because the standard deviation of the distribution scales as $N^{-1/6}$ (first derived in).
For example:
    $F_{2}(x)=\lim _{N\to \infty }\operatorname {Prob} \left((\lambda _{\max }-{\sqrt {4N}})N^{1/6}\leq x\right),$
where the matrix is sampled from the gaussian unitary ensemble with off-diagonal variance $1$.
The definition of the Tracy–Widom distributions $F_{\beta }$ may be extended to all $\beta >0$ (Slide 56 in Edelman (2003), Ramírez, Rider & Virág (2006)).
One may naturally ask for the limit distribution of second-largest eigenvalues, third-largest eigenvalues, etc. They are known.

## Functional forms
### Fredholm determinant

$F_{2}$ can be given as the Fredholm determinant
    $F_{2}(s)=\det(I-A_{s})=1+\sum _{n=1}^{\infty }{\frac {(-1)^{n}}{n!}}\int _{(s,\infty )^{n}}\det _{i,j=1,...,n}[A_{s}(x_{i},x_{j})]dx_{1}\cdots dx_{n}$
of the kernel $A_{s}$ ("Airy kernel") on square integrable functions on the half line $(s,\infty )$, given in terms of Airy functions Ai by
    $A_{s}(x,y)={\begin{cases}{\frac {\mathrm {Ai} (x)\mathrm {Ai} '(y)-\mathrm {Ai} '(x)\mathrm {Ai} (y)}{x-y}}\quad {\text{if }}x\neq y\\Ai'(x)^{2}-x(Ai(x))^{2}\quad {\text{if }}x=y\end{cases}}$

### Painlevé transcendents

$F_{2}$ can also be given as an integral
    $F_{2}(s)=\exp \left(-\int _{s}^{\infty }(x-s)q^{2}(x)\,dx\right)$
in terms of a solution of a Painlevé equation of type II
    $q^{\prime \prime }(s)=sq(s)+2q(s)^{3}\,$
with boundary condition q(s)∼Ai(s), s→∞.{\textstyle \displaystyle q(s)\sim {\textrm {Ai}}(s), s\to \infty .} This function $q$ is a Painlevé transcendent.
Other distributions are also expressible in terms of the same $q$:
    ${\begin{aligned}F_{1}(s)&=\exp \left(-{\frac {1}{2}}\int _{s}^{\infty }q(x)\,dx\right)\,\left(F_{2}(s)\right)^{1/2}\\F_{4}(s/{\sqrt {2}})&=\cosh \left({\frac {1}{2}}\int _{s}^{\infty }q(x)\,dx\right)\,\left(F_{2}(s)\right)^{1/2}.\end{aligned}}$

### Functional equations

Define ${\begin{aligned}F(x)&=\exp \left(-{\frac {1}{2}}\int _{x}^{\infty }(y-x)q(y)^{2}\,dy\right)\\E(x)&=\exp \left(-{\frac {1}{2}}\int _{x}^{\infty }q(y)\,dy\right)\end{aligned}}$then$F_{1}(x)=E(x)F(x),\quad F_{2}(x)=F(x)^{2},\quad \quad F_{4}\left({\frac {x}{\sqrt {2}}}\right)={\frac {1}{2}}\left(E(x)+{\frac {1}{E(x)}}\right)F(x)$

## Occurrences

Other than in random matrix theory, the Tracy–Widom distributions occur in many other probability problems.
Let $l_{n}$ be the length of the longest increasing subsequence in a random permutation sampled uniformly from $S_{n}$, the permutation group on n elements. Then the cumulative distribution function of ${\frac {l_{n}-2N^{1/2}}{N^{1/6}}}$ converges to $F_{2}$.

## Third-order phase transition

The Tracy–Widom distribution exhibits a third-order phase transition in the large deviation behavior of the largest eigenvalue of a random matrix. This transition occurs at the edge of the Wigner semicircle distribution, where the probability density of the largest eigenvalue follows distinct scaling laws depending on whether it deviates to the left or right of the edge.
Let $\Phi (w)$ denote the rate function governing the large deviations of the largest eigenvalue $\lambda _{\max }$. For a Gaussian unitary ensemble, the probability density function of $\lambda _{\max }$ satisfies, for large $N$,
    $P(\lambda _{\max }=w)\approx \exp \left(-\beta N^{p}\Phi (w)\right),$
where $p=2$ for deviations to the left of the spectral edge and $p=1$ for deviations to the right. When the small-deviation parts of the probability density are included, we have$P\left(\lambda _{\max }=w,N\right)\approx {\begin{cases}\exp \left[-\beta N^{2}\Phi _{-}(w)\right]&,w<{\sqrt {2}}\&|w-{\sqrt {2}}|\sim {\mathcal {O}}(1)\\{\sqrt {2}}N^{\frac {2}{3}}{\mathcal {F}}_{\beta }^{\prime }\left({\sqrt {2}}N^{\frac {2}{3}}(w-{\sqrt {2}})\right)&,\\\exp \left[-\beta N\Phi _{+}(w)\right]&,w>{\sqrt {2}}\&|w-{\sqrt {2}}|\sim {\mathcal {O}}\left(N^{-{\frac {2}{3}}}\right)\end{cases}}$
The rate function $\Phi (w)$ is given by separate expressions for $w<{\sqrt {2}}$ and $w>{\sqrt {2}}$. ${\begin{aligned}\Phi _{-}(w)=&{\frac {1}{108}}\left[36w^{2}-w^{4}-\left(15w+w^{3}\right){\sqrt {w^{2}+6}}\right.\\&\left.+27\left(\ln 18-2\ln \left(w+{\sqrt {w^{2}+6}}\right)\right)\right],w<{\sqrt {2}}.\end{aligned}}$
$\Phi _{+}(w)={\frac {1}{2}}w{\sqrt {w^{2}-2}}+\ln \left[{\frac {w-{\sqrt {w^{2}-2}}}{\sqrt {2}}}\right]$
Near the critical point $w={\sqrt {2}}$, the leading order behavior is
    $\Phi _{-}(w)\sim {\frac {1}{6{\sqrt {2}}}}({\sqrt {2}}-w)^{3},\quad w\to {\sqrt {2}}^{-}.$
    $\Phi _{+}(w)\sim {\frac {2^{7/4}}{3}}(w-{\sqrt {2}})^{3/2},\quad w\to {\sqrt {2}}^{+}.$
The third derivative of $\Phi (w)$ is discontinuous at $w={\sqrt {2}}$, which classifies this as a third-order phase transition. This type of transition is analogous to the Gross-Witten-Wadia phase transition in lattice gauge theory and the Douglas-Kazakov phase transition in two-dimensional quantum chromodynamics. The discontinuity in the third derivative of the free energy marks a fundamental change in the behavior of the system, where fluctuations transition between different scaling regimes.
This third-order transition has also been observed in problems related to the maximal height of non-intersecting Brownian excursions, conductance fluctuations in mesoscopic systems, and entanglement entropy in random pure states.
To interpret this as a third-order transition in statistical mechanics, define the (generalized) free energy density of the system as${\mathcal {F}}(w)=-{\frac {1}{N^{2}}}\ln P\left(\lambda _{\max }=w,N\right)$then at the $N\to \infty$ limit, ${\mathcal {F}}(w)={\begin{cases}\Phi _{-}(w)&w<{\sqrt {2}}\\0&w>{\sqrt {2}}\end{cases}}$ has continuous first and second derivatives at the critical point $w={\sqrt {2}}$, but a discontinuous third derivative.
The $-\ln P\propto N^{2}$ lower end can be interpreted as the strongly interacting regime, where $N$ objects are interacting strongly pairwise, so the total energy is proportional to $N^{2}$. The $-\ln P\propto N$ upper end can be interpreted as the weakly interacting regime, where the objects are basically not interacting, so the total energy is proportional to $N$. The Tracy–Widom distribution phase transition then occurs at the point as the system switches from strongly to weakly interacting.

### Coulomb gas model

This can be visualized in the Coulomb gas model by considering a gas of electric charges in a $V(x)={\frac {1}{2}}x^{2}$ potential well. The distribution of the charges is the same as the distribution of the matrix eigenvalues. This gives the Wigner semi-circle law. To find the distribution of the largest eigenvalue, we take a wall and push against the Coulomb gas. If the wall is above $+{\sqrt {2}}$, then most of the gas remains unaffected, and we are in the weak interaction regime. If the wall is below $+{\sqrt {2}}$, then the entire bulk of the Coulomb gas is affected, and we are in the strong interaction regime.
The minimal Coulomb gas distribution is explicitly solvable as$\rho _{w}^{*}(\lambda )={\begin{cases}{\frac {1}{\pi }}{\sqrt {2-\lambda ^{2}}},\quad {\text{ with }}\quad -{\sqrt {2}}\leq \lambda \leq {\sqrt {2}}&{\text{ for }}w>{\sqrt {2}}\\{\frac {\sqrt {\lambda +L(w)}}{2\pi {\sqrt {w-\lambda }}}}[w+L(w)-2\lambda ]\quad {\text{ with }}\quad -L(w)\leq \lambda \leq w&{\text{ for }}w<{\sqrt {2}}\end{cases}}$where $w$ is the position of the wall, and $L(w)={\frac {2{\sqrt {w^{2}+6}}-w}{3}}$.

## Asymptotics
### Probability density function

Let $f_{\beta }(x)=F_{\beta }'(x)$ be the probability density function for the distribution, then$f_{\beta }(x)\sim {\begin{cases}e^{-{\frac {\beta }{24}}|x|^{3}},\quad x\to -\infty \\e^{-{\frac {2\beta }{3}}|x|^{3/2}},\quad x\to +\infty \end{cases}}$In particular, we see that it is severely skewed to the right: it is much more likely for $\lambda _{max}$ to be much larger than $2\sigma {\sqrt {N}}$ than to be much smaller. This could be intuited by seeing that the limit distribution is the semicircle law, so there is "repulsion" from the bulk of the distribution, forcing $\lambda _{max}$ to be not much smaller than $2\sigma {\sqrt {N}}$.
At the $x\to -\infty$ limit, a more precise expression is (equation 49)$f_{\beta }(x)\sim \tau _{\beta }|x|^{(\beta ^{2}+4-6\beta )/16\beta }\exp \left[-\beta {\frac {|x|^{3}}{24}}+{\sqrt {2}}{\frac {\beta -2}{6}}|x|^{3/2}\right]$for some positive number $\tau _{\beta }$ that depends on $\beta$.

### Cumulative distribution function

At the $x\to +\infty$ limit,${\begin{aligned}F(x)&=1-{\frac {e^{-{\frac {4}{3}}x^{3/2}}}{32\pi x^{3/2}}}{\biggl1-{\frac {35}{24x^{3/2}}}+{\cal {O}}(x^{-3}){\biggr )},\\E(x)&=1-{\frac {e^{-{\frac {2}{3}}x^{3/2}}}{4{\sqrt {\pi }}x^{3/2}}}{\biggl1-{\frac {41}{48x^{3/2}}}+{\cal {O}}(x^{-3}){\biggr )}\end{aligned}}$and at the $x\to -\infty$ limit,${\begin{aligned}F(x)&=2^{1/48}e^{{\frac {1}{2}}\zeta ^{\prime }(-1)}{\frac {e^{-{\frac {1}{24}}|x|^{3}}}{|x|^{1/16}}}\left(1+{\frac {3}{2^{7}|x|^{3}}}+O(|x|^{-6})\right)\\E(x)&={\frac {1}{2^{1/4}}}e^{-{\frac {1}{3{\sqrt {2}}}}|x|^{3/2}}{\Biggl1-{\frac {1}{24{\sqrt {2}}|x|^{3/2}}}+{\cal {O}}(|x|^{-3}){\Biggr )}.\end{aligned}}$where $\zeta$ is the Riemann zeta function, and $\zeta '(-1)=-0.1654211437$.
This allows derivation of $x\to \pm \infty$ behavior of $F_{\beta }$. For example,${\begin{aligned}1-F_{2}(x)&={\frac {1}{32\pi x^{3/2}}}e^{-4x^{3/2}/3}(1+O(x^{-3/2})),\\F_{2}(-x)&={\frac {2^{1/24}e^{\zeta ^{\prime }(-1)}}{x^{1/8}}}e^{-x^{3}/12}{\biggl1+{\frac {3}{2^{6}x^{3}}}+O(x^{-6}){\biggr )}.\end{aligned}}$

### Painlevé transcendent

The Painlevé transcendent has asymptotic expansion at $x\to -\infty$ (equation 4.1 of)$q(x)={\sqrt {-{\frac {x}{2}}}}\left(1+{\frac {1}{8}}x^{-3}-{\frac {73}{128}}x^{-6}+{\frac {10657}{1024}}x^{-9}+O(x^{-12})\right)$This is necessary for numerical computations, as the $q\sim {\sqrt {-x/2}}$ solution is unstable: any deviation from it tends to drop it to the $q\sim -{\sqrt {-x/2}}$ branch instead.

## Numerics

Numerical techniques for obtaining numerical solutions to the Painlevé equations of the types II and V, and numerically evaluating eigenvalue distributions of random matrices in the beta-ensembles were first presented by Edelman & Persson (2005) using MATLAB. These approximation techniques were further analytically justified in Bejan (2005) and used to provide numerical evaluation of Painlevé II and Tracy–Widom distributions (for $\beta =1,2,4$) in S-PLUS. These distributions have been tabulated in Bejan (2005) to four significant digits for values of the argument in increments of 0.01; a statistical table for p-values was also given in this work. Bornemann (2010) gave accurate and fast algorithms for the numerical evaluation of $F_{\beta }$ and the density functions $f_{\beta }(s)=dF_{\beta }/ds$ for $\beta =1,2,4$. These algorithms can be used to compute numerically the mean, variance, skewness and excess kurtosis of the distributions $F_{\beta }$.
| $\beta$ | Mean | Variance | Skewness | Excess kurtosis |
| 1 | −1.2065335745820 | 1.607781034581 | 0.29346452408 | 0.1652429384 |
| 2 | −1.771086807411 | 0.8131947928329 | 0.224084203610 | 0.0934480876 |
| 4 | −2.306884893241 | 0.5177237207726 | 0.16550949435 | 0.0491951565 |
Functions for working with the Tracy–Widom laws are also presented in the R package 'RMTstat' by Johnstone et al. (2009) and MATLAB package 'RMLab' by Dieng (2006).
For a simple approximation based on a shifted gamma distribution see Chiani (2014).
Shen & Serkh (2022) developed a spectral algorithm for the eigendecomposition of the integral operator $A_{s}$, which can be used to rapidly evaluate Tracy–Widom distributions, or, more generally, the distributions of the $k$th largest level at the soft edge scaling limit of Gaussian ensembles, to machine accuracy.

## Tracy-Widom and KPZ universality

The Tracy-Widom distribution appears as a limit distribution in the universality class of the KPZ equation. For example it appears under $t^{1/3}$ scaling of the one-dimensional KPZ equation with fixed time.