Error in robustfit when use instead of lscov function

10 次查看(过去 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
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.
Please refer this documentation for more information on dimensions of X and Y.
Hope this will help you.
-Sindhu

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Least Squares 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by