Coding my own Cholesky Decomposition Algorithm help?
17 次查看(过去 30 天)
显示 更早的评论
I understand the idea of Cholesky Decomposition and can find it manually, but I am having a hard time creating my own MATLAB code to find a cholesky factor R, for a given positive definite matrix A.
So far my code is,
function[R] = getCholeskyFactor(A,n)
R=zeros(n,n);
for i=1:n
for j=1:n
R(i,i) = sqrt(A(i,i)-((R(j,i))^2))
for k = 1:n
R(i,j) = (A(i,j)-R(k,i)*R(k,j))/R(i,i)
end
end
end
But I realize I am missing different summations because r(i,i) = sqrt(A(i,i) - sum(R(k,i)^2,k=1:(i-1)) and r(i,j) = (A(i,j) - sum(R(k,i)*(R(k,j)),k=1:(i-1))/R(i,i).
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!