how to search and keep all the possible combinations with a certain accuracy
2 ビュー (過去 30 日間)
古いコメントを表示
I am trying to do some simple combination, I have a Matrix of X consists of 2000 variables and a Y I want to each time pick 4 of the variables from X and make a regression and keep only those sets that have higher R than 0.9 . I found another solution based on 3 matrices, what want is one matrix and I tried to amend the code but somewhat I did not get it right
tic
X1 = rand(40,2000);
Y = rand(40,1);
in = ones(40,1);
R = zeros(size(:,1),1);
for c = 1:size(:,1)
X = [in X1(:,i)];
yhat = X*(X\Y);
ybar = mean(Y);
ssr = norm(yhat - ybar)^2;
sst = norm(Y - ybar)^2;
R(c) = ssr/sst;
end
toc
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Descriptive Statistics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!