How to fix the replacement rate in bootstrap method?

조회 수: 1 (최근 30일)
Andi
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:
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에서 Resampling Techniques에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by