Skip to content

Commit ecd1eba

Browse files
jiahaovtjnash
authored andcommitted
Jacobi growth process (hasn't been tested this rigorously, but seems to work, up to the answer being transposed and in reverse order in Julia compared to Matlab.)
1 parent 16e1772 commit ecd1eba

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

demos/jacobigrowth2.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#jacobigrowth2.jl
2+
3+
using Distributions
4+
function jacobigrowth2(m1,m2,p,beta)
5+
CJ=eye(p)
6+
SJ=zeros(p, p)
7+
for k=1:m2
8+
Ju = sqrt(rand(Chisq(beta),1,p))
9+
Ju *= sqrt( rand(Chisq(beta*p)) / rand(Chisq(beta*(k+m1-p))) ) / norm(Ju)
10+
_, _, _, CJ, SJ=svd(CJ,[SJ; Ju])
11+
end
12+
diag(CJ)
13+
end

0 commit comments

Comments
 (0)