Error in robustfit when use instead of lscov function

4 views (last 30 days)
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 Comments
Sindhu Yerragunta
Sindhu Yerragunta on 11 Jan 2018
Edited: Sindhu Yerragunta on 11 Jan 2018
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.
Please refer this documentation for more information on dimensions of X and Y.
Hope this will help you.
-Sindhu

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!