I want to do bootstrap analysis by using 20*1 matrix.

4 ビュー (過去 30 日間)
Chris
Chris 2022 年 10 月 26 日
回答済み: the cyclist 2022 年 10 月 27 日
I want to draw 500 samples from the 20*1 matrix (20 pairs of observations).
In this case, what codes do I have to use?

採用された回答

the cyclist
the cyclist 2022 年 10 月 27 日
One way is
% Pretend input data
M = rand(20,1);
idx = randi(20,500,1);
samples = M(idx);

その他の回答 (1 件)

the cyclist
the cyclist 2022 年 10 月 27 日
If you have the Statistics and Machine Learning Toolbox, you can do
% Pretend input data
M = rand(20,1);
samples = randsample(M,500,true);

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by