Why code fail to bootstrap when points lower than a certain limit?

1 ビュー (過去 30 日間)
Andi
Andi 2022 年 7 月 21 日
編集済み: Andi 2022 年 7 月 21 日
Hi everyone,
My script stop bootstraping when the observtions are lower than a certain limit. May someoen suggets how can i fix this or what are the other possible wayes to bootstrap and computing 99%, 95% and 68% or 50% of the bootsrap population? (data is also attached)
ss = readmatrix('data.csv');
nBoot=2000;
for i=1:148;
bb=ss(:,i);
X = bb(~isnan(bb));
[bci(:,i),bmeans(:,i)] = bootci(nBoot,{@mean,X},'alpha',.23,'type','per');
bmu(i,1) = mean(bmeans(:,i));
end
R_bound=bci';
R_mean=bmu;
R_upper=R_bound(:,2);
R_lower=R_bound(:,1);
(The dataset consist of numbers and NaN values, after removing NaN the actual values for bootsrap within each colum are varies between 2 to 40. However, the code stop wokring when the total enteries are lower than 2). For example, the above code working when i remove few columns with low data points
ss = readmatrix('data.csv');
ss(:,[15, 17, 18, 35, 36, 45]) = []; % removing columns with few data points.
nBoot=2000;
for i=1:142;
bb=ss(:,i);
X = bb(~isnan(bb));
[bci(:,i),bmeans(:,i)] = bootci(nBoot,{@mean,X},'alpha',.23,'type','per');
bmu(i,1) = mean(bmeans(:,i));
end
R_bound=bci';
R_mean=bmu;
R_upper=R_bound(:,2);
R_lower=R_bound(:,1);
May someone help me out here.
Thank you!

回答 (0 件)

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by