Bootstrap CI for a Bootstrapped sample
Show older comments
I have a time series of stock returns (Tx1) with T=3000 and want to calculate confidence intervals in a two-step process, following this procedure:
"To derive the confidence intervals, we implement a bootstrap as proposed in Efron (1979) using the N = 5000 annual returns from the common block-bootstrap in the first step. Within this second-step bootstrap, we again create NB = 5000 bootstrap resamples, each consisting of 500 annual returns. "
The methodology involves a two-step bootstrap process: first, using a common block-bootstrap with N=5000 annual returns (TxN), and then within this, creating NB=2000 bootstrap resamples, each consisting of 500 annual returns.
For the first-step. I managed to get the block-bootstraped returns. However, for the second steps I have questions.
I found an insightful answer on MATLAB Central (link provided) that demonstrates bootstrapping CI. In the low-level code, I successfully modified the sample size of the bootstrap by changing NB2_size to 500
nBoot2 = 2000; %number of bootstraps
In the low-level code, I can modifie the sample size of the boostrap
NB2_size=500% instead of size(data)
bootMeans = nan(1,nBoot2);
for i = 1:nBoot2
bootMeans(i) = mean(data(randi(numel(data),NB2_size)));
end
Now, when using the bootci function, I'm unsure how to adjust the sample size. The existing code uses nBoot2 = 2000 for the number of bootstraps and calculates a 90% confidence interval with alpha=.1 and 'type','per'.
[bci,bmeans] = bootci(nBoot2,{@mean,data},'alpha',.1,'type','per'); %90 confidence interval
% Compute bootstrap sample mean
bmu = mean(bmeans);
How can I adapt the bootci function to adapt the sample size for the inner bootstrap (nBoot2) to a specific data size (NB2_size) and ensuring the correct calculation of confidence intervals?"
Accepted Answer
More Answers (0)
Categories
Find more on Resampling Techniques in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!