How to fix the replacement rate in bootstrap method?

2 ビュー (過去 30 日間)
Andi 2022 年 6 月 29 日
コメント済み: Adam Danz 2022 年 6 月 29 日
Hi everyone,
My script of bootstrap resampling working very well. However, I require to visulize my data in different aspects. For example, I want to see the variation of bootstrap mean and its upper/lower limits, when i vary the length of bootstrap window and fix the replacement rate.
My data set consists of 168 rows and varying number of columns (20 to 60 after removing nan enteries). Afterward, I use my bootstrap scipt for nboots=2000, and get a mean value along its upper lower bounds. However, in my script there is no option to fix the replacement rate. For exmaple, I want to compute the bootsrap in such a way that length of random matrix is 20 with a replacement of 2, 4, 8, 10 values.
May someoen help me to modify my script:
for i=1:148;
X = bb(~isnan(bb));
[bci(:,i),bmeans(:,i)] = bootci(nBoot,{@mean,X},'alpha',.05,'type','norm');
bmu(i,1) = mean(bmeans(:,i));
  1 件のコメント
Adam Danz
Adam Danz 2022 年 6 月 29 日
To create each bootstrap sample, bootci randomly selects with replacement n out of the n rows of data. If your question is how to change the value of n, you'll need to temporarily change the data between each bootstrap sample which will require making your own custom bootstrap function. You could use randi to make a radome selection of n rows of data with replacement.


回答 (0 件)


Help Center および File ExchangeStatistics and Machine Learning Toolbox についてさらに検索



Community Treasure Hunt

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

Start Hunting!

Translated by