How to fix the replacement rate in bootstrap method?

1 次查看(过去 30 天)
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:
s=data;
nBoot=2000;
for i=1:148;
bb=s(:,i);
X = bb(~isnan(bb));
[bci(:,i),bmeans(:,i)] = bootci(nBoot,{@mean,X},'alpha',.05,'type','norm');
bmu(i,1) = mean(bmeans(:,i));
end
R_bound=bci';
R_mean=bmu;
R_upper=R_bound(:,2);
R_lower=R_bound(:,1);
  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 CenterFile Exchange 中查找有关 Statistics 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