Error in robustfit when use instead of lscov function
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi,
I want to use robustfit instead of lscov function but I got the below error when I run rboustfit function:
%% *Warning: X is rank deficient, rank = 2 > In statrobustfit (line 47) In robustfit (line 106) Error using vertcat Dimensions of matrices being concatenated are not consistent.
Error in statrobustfit (line 49) b(perm,:) = [R(1:xrank,1:xrank) \ (Q(:,1:xrank)'*y); zeros(p-xrank,1)];
Error in robustfit (line 106) [varargout{:}] = statrobustfit(X,y,wfun,tune,wasnan,doconst,priorw,dowarn);*
%%
When I used lscov function its completely fine. In that case I use lscov to compute a general least-squares fit by providing an observation covariance matrix: b=lscov(X,y,V) where X is 84*2, y is 84*15960 and V is 84*84 matrix.
I use robustfit like b=robustfit(X,y), in that case how can I provide an observation covariance matrix like lscov function.
Please help me to figure out this problem.
Regards
댓글 수: 2
Sindhu Yerragunta
2018년 1월 11일
편집: Sindhu Yerragunta
2018년 1월 11일
Hi NS,
You can use the weight function as 'ols' to get the same behavior as Iscov function. And you can add weights and tune it based on the needs in place of covariance.
The error which you are facing might be because of the dimensions of X and Y are not consistant and I just want to know why the dimensions of X is 84*2 and Y is 84*15960.
Hope this will help you.
-Sindhu
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Least Squares에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!