Fixed B matrix in bidiag2
This commit is contained in:
parent
cec7b0a9d7
commit
76eb148928
1 changed files with 4 additions and 3 deletions
|
|
@ -60,8 +60,7 @@ Julia version of the bidiag2 MATLAB function in Björck and Indahl (2017)
|
||||||
|
|
||||||
### Returns:
|
### Returns:
|
||||||
- beta - Matrix with regression coefficients (including constant term if centre==true)
|
- beta - Matrix with regression coefficients (including constant term if centre==true)
|
||||||
- W, T, B - Matrices such that X \approx T*B*W'.
|
- W, B, T - Matrices such that X \approx T*B*W'.
|
||||||
B in compact form, use following to create full: B2 = zeros(A,A); B2[diagind(B2)] = B[:,1]; B2[diagind(B2,1)] = B[2:end,2];
|
|
||||||
"""
|
"""
|
||||||
function bidiag2(X, y, A, centre=true)
|
function bidiag2(X, y, A, centre=true)
|
||||||
|
|
||||||
|
|
@ -117,6 +116,8 @@ if centre
|
||||||
beta = [b0; beta];
|
beta = [b0; beta];
|
||||||
end
|
end
|
||||||
|
|
||||||
returnvals = beta, W, T, B
|
B = Bidiagonal(B[:,1], B[1:end-1,2], :U);
|
||||||
|
|
||||||
|
returnvals = beta, W, B, T
|
||||||
return returnvals
|
return returnvals
|
||||||
end
|
end
|
||||||
Loading…
Add table
Reference in a new issue