({{, (RefLink[GaussianOrthogonalMatrixDistribution, paclet:ref/GaussianOrthogonalMatrixDistribution])[σ,n] 
represents a Gaussian orthogonal matrix distribution with matrix dimensions {n,n} and scale parameter σ.}, {, (RefLink[GaussianOrthogonalMatrixDistribution, paclet:ref/GaussianOrthogonalMatrixDistribution])[n]
represents a Gaussian orthogonal matrix distribution with unit scale parameter.}})

OpenersNotesSection(Spacer1)Details

(RefLink[GaussianOrthogonalMatrixDistribution, paclet:ref/GaussianOrthogonalMatrixDistribution]) is also known as Gaussian orthogonal ensemble, or GOE.

(RefLink[GaussianOrthogonalMatrixDistribution, paclet:ref/GaussianOrthogonalMatrixDistribution]) is a distribution of a symmetric matrix (x+(Transpose[x]))/2, where x is a square matrix with independent identically distributed matrix elements that follow (RefLink[NormalDistribution, paclet:ref/NormalDistribution])[0,σ].

The probability density for matrix z is proportional to exp(-(1/(2(σ^2))) Tr[z.z]).

The scale parameter σ can be any positive number, and n can be any positive integer.

(RefLink[GaussianOrthogonalMatrixDistribution, paclet:ref/GaussianOrthogonalMatrixDistribution]) can be used with such functions as (RefLink[MatrixPropertyDistribution, paclet:ref/MatrixPropertyDistribution]), (RefLink[EstimatedDistribution, paclet:ref/EstimatedDistribution]), and (RefLink[RandomVariate, paclet:ref/RandomVariate]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (15)

OpenersExampleSection0(Spacer1)Basic Examples  (4)

Generate a pseudorandom matrix from GOE:

RandomVariate[GaussianOrthogonalMatrixDistribution[3]]

Check that it is symmetric:

SymmetricMatrixQ[%]

The entries of a matrix drawn from (RefLink[GaussianOrthogonalMatrixDistribution, paclet:ref/GaussianOrthogonalMatrixDistribution]) are jointly Gaussian and uncorrelated, with entries off the diagonal having half the variance of entries on the diagonal:

sample=RandomVariate[MatrixPropertyDistribution[{(IndexedDefault[x, 1, 1]),(IndexedDefault[x, 2, 2]),(IndexedDefault[x, 1, 2])},x\[Distributed]GaussianOrthogonalMatrixDistribution[2]],10^4];

DistributionFitTest[sample,MultinormalDistribution[{0,0,0},DiagonalMatrix[{1,1,1/2}]],"TestConclusion"]

Use (RefLink[MatrixPropertyDistribution, paclet:ref/MatrixPropertyDistribution]) to sample eigenvalues of GOE matrices:

RandomVariate[MatrixPropertyDistribution[Eigenvalues[x],x\[Distributed]GaussianOrthogonalMatrixDistribution[2000]]]//Histogram

Mean and variance:

Mean[GaussianOrthogonalMatrixDistribution[1,3]]//MatrixForm

Variance[GaussianOrthogonalMatrixDistribution[1,3]]//MatrixForm

OpenersExampleSection1(Spacer1)Scope  (4)

Generate a single pseudorandom matrix:

RandomVariate[GaussianOrthogonalMatrixDistribution[2]]

Generate a set of pseudorandom matrices:

MatrixForm/@RandomVariate[GaussianOrthogonalMatrixDistribution[2],3]

Compute statistical properties numerically:

𝒟=MatrixPropertyDistribution[Det[m],m\[Distributed]GaussianOrthogonalMatrixDistribution[4]];

Estimate probability that the random matrix determinant is bounded away from zero:

NProbability[Abs[det]>0.1,det\[Distributed]𝒟]

Distribution parameters estimation:

dist=GaussianOrthogonalMatrixDistribution[2,3];sample=RandomVariate[dist,10^3];

Estimate the distribution parameters from sample data:

edist=EstimatedDistribution[sample,GaussianOrthogonalMatrixDistribution[σ,n]]

Compare (RefLink[LogLikelihood, paclet:ref/LogLikelihood]) of the distributions:

LogLikelihood[#,sample]&/@{edist,dist}

OpenersExampleSection3(Spacer1)Applications  (3)

Sample eigenvalue spacing distribution in a 2×2 GOE matrix:

dist=MatrixPropertyDistribution[{-1,1}.MinMax[Eigenvalues[x]],x\[Distributed]GaussianOrthogonalMatrixDistribution[2]];

gaps=Normalize[RandomVariate[dist,10000],Mean];

Compare the histogram with the closed form, also known as Wigner surmise for Dyson index β==1:

WignerSurmisePDF[x_,β:1]:=Pi (x/2) Exp[-Pi (x/2)^2]

Show[Histogram[gaps,{0.1},PDF],Plot[WignerSurmisePDF[x,1],{x,0,3}]]

Sample the joint distribution of eigenvalues of 2×2 GOE matrix:

λ𝒟=MatrixPropertyDistribution[Eigenvalues[𝓂],𝓂\[Distributed]GaussianOrthogonalMatrixDistribution[2]];

Use (RefLink[RandomSample, paclet:ref/RandomSample]) to randomly permute eigenvalues to compensate for algorithm-specific ordering:

evs=RandomSample/@RandomVariate[λ𝒟,10^5];

Visualize estimated density:

SmoothHistogram3D[evs]

Compare the estimated density to the known closed-form result:

LevelDistribution[n_Integer,β_]:=ProbabilityDistribution[(1/(((2π))^(n/2)))((∏_j^n)((Gamma[1+(β/2)])/(Gamma[1+((β j)/2)])))((∏_(i=1)^n)(∏_j^(i-1))((Abs[(Subscript[λ, i])-(Subscript[λ, j])])^β))Exp[-(1/2)(∑_(i=1)^n)((Subscript[λ, i])^2)],Array[{(Subscript[λ, #]),-∞,∞}&,n,1,Sequence]]

Evaluate the density for the case of 2×2 GOE matrices:

pdf=PDF[LevelDistribution[2,1],{λ1,λ2}]

Compare the density to the histogram density estimate from the sample:

Show[Histogram3D[evs,{0.5},PDF,ChartStyle->Opacity[0.5],PlotRange->All],
Plot3D[pdf,{λ1,-4,4},{λ2,-4,4},PlotStyle->None,MeshStyle->Thick,PlotRange->All]]

Confirm the agreement with a goodness-of-fit test:

DistributionFitTest[evs,LevelDistribution[2,1]]

Illustrate complexity of matrix inversion using random symmetric matrices:

inverseTiming[size_]:=With[{mat=RandomVariate[GaussianOrthogonalMatrixDistribution[size]]},RepeatedTiming[Inverse[mat]][[1]]]

data=Table[{n,inverseTiming[n]},{n,{50,100,250,500,1000,2000,3000,5000}}];

ListLogLogPlot[data,Filling->Axis]

OpenersExampleSection4(Spacer1)Properties & Relations  (4)

(RefLink[MatrixExp, paclet:ref/MatrixExp]) applied to i x with x sampled from (RefLink[GaussianOrthogonalMatrixDistribution, paclet:ref/GaussianOrthogonalMatrixDistribution]) is symmetric and unitary:

MatrixExp[I RandomVariate[GaussianOrthogonalMatrixDistribution[3]]]

UnitaryMatrixQ[%]&&SymmetricMatrixQ[%]

Matrix elements of the upper-triangular part of a GOE matrix are independent Gaussian random variables:

upperElems[n_,symMat_]:=Extract[symMat,Join[Table[{k,k},{k,n}],Subsets[Range[n],{2}]]]

Extract independent components of a 3×3 random matrix:

MatrixForm[m=RandomVariate[GaussianOrthogonalMatrixDistribution[3]]]

upperElems[3,m]

Use (RefLink[IndependenceTest, paclet:ref/IndependenceTest]) to verify independence:

data=RandomVariate[MatrixPropertyDistribution[upperElems[2,x],x\[Distributed]GaussianOrthogonalMatrixDistribution[2]],10^4];

Table[If[i==j,Histogram[data[[All,i]],Automatic,PDF],ListPlot[data[[All,{i,j}]],PlotLabel->Row[{IndependenceTest[data[[All,i]],data[[All,j]]]}]]],{i,3},{j,3}]//Grid[#,Dividers->All]&

The spectral density of large GOE matrix converges to (RefLink[WignerSemicircleDistribution, paclet:ref/WignerSemicircleDistribution]):

n=300;
eigvs=RandomVariate[MatrixPropertyDistribution[Eigenvalues[x],x\[Distributed]GaussianOrthogonalMatrixDistribution[n]],250];

Show[Histogram[(Join@@eigvs)/Sqrt[2n],{0.025},PDF],Plot[PDF[WignerSemicircleDistribution[1],x],{x,-1,1}]]

The distribution of the scaled largest eigenvalue of large GOE matrices converges to (RefLink[TracyWidomDistribution, paclet:ref/TracyWidomDistribution]):

n=300;
(Subscript[λ, max])=RandomVariate[MatrixPropertyDistribution[Max[Eigenvalues[x]],x\[Distributed]GaussianOrthogonalMatrixDistribution[n]],10^3];

Show[Histogram[((Subscript[λ, max])-(Sqrt[2 n]))(Sqrt[2]) (n^(1/6)),{0.3},PDF],Plot[PDF[TracyWidomDistribution[1],x ],{x,-5,3},PlotStyle->Thick]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[NormalDistribution, paclet:ref/NormalDistribution])  ▪  (RefLink[GaussianUnitaryMatrixDistribution, paclet:ref/GaussianUnitaryMatrixDistribution])  ▪  (RefLink[GaussianSymplecticMatrixDistribution, paclet:ref/GaussianSymplecticMatrixDistribution])  ▪  (RefLink[SymmetricMatrixQ, paclet:ref/SymmetricMatrixQ])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Random Variables, paclet:guide/RandomVariables])}, {▪(RefLinkPlain[Matrix Distributions, paclet:guide/MatrixDistributions])}})}})