Skip to content

Commit c0456cf

Browse files
committed
Removes singularities
1 parent abddf0f commit c0456cf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/GaussianEnsembleSamples.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ chi(df) = df==0? 0.0 : sqrt(rand(Chisq(df)))
3434
#############################
3535

3636
#Generates a NxN symmetric Wigner matrix
37+
#For beta=1,2,4, generates a NxN matrix from the Gaussian orthogonal/unitary/
38+
#symplectic ensembles
3739
function GaussianHermiteMatrix(n::Integer, beta::Integer)
3840
if beta == 1 #real
3941
A = randn(n, n)
@@ -77,6 +79,8 @@ end
7779
#Generates a NxN Hermitian Wishart matrix
7880
#n: exterior dimension of matrix
7981
#m: "interior" dimension of the matrix
82+
#These are sometimes called white Wishart matrices, reflecting their properties
83+
#as random covariance matrices with underlying covariance = identity.
8084
function GaussianLaguerreMatrix(n::Integer, m::Integer, beta::Integer)
8185
if beta == 1 #real
8286
A = randn(n, m)
@@ -127,7 +131,7 @@ function GaussianLaguerreDensity(n::Integer, m::Integer, beta::Real, x::Real)
127131
end
128132
function GaussianLaguerreDensity(c::Real, beta::Real, x::Real)
129133
#There is also a finite mass at 0 for c>1 of weight (1 - 1/c)
130-
if c>1 && x==0 return Inf
134+
#if c>1 && x==0 return Inf end
131135
am, ap = beta*(1-sqrt(c))^2, beta*(1-sqrt(c))^2
132136
sqrt((x-am)*(ap-x))/(2*pi*beta*x*c)
133137
end
@@ -242,7 +246,7 @@ function GaussianJacobiDensity(c1::Real, c2::Real, beta::Real, x::Real)
242246
if !(0<=c1<=1) error(string("Need 0<=c1<=1 but you have c1=", c1)) end
243247
if !(beta==1) error(string("beta!=1 not implemented")) end
244248
#Finite mass at 0 of weight (1-1/c2)
245-
if c2>1 && x==0 return Inf
249+
#if c2>1 && x==0 return Inf end
246250
b0=c1*x-c2*x-c1+2
247251
b1=-2c2*x^2+2x-3c1*x+c1+c2*x-1+2c1*x^2
248252
b2=c1*x-2c1*x^2+c2*x^2-x^3*c2+x^3*c1

0 commit comments

Comments
 (0)