bootstrap function parametric approach or non-parametric
Show older comments
I want to employ the bootstrap function in Matlab but I didn't find any explanation whether it is parametric bootstrapping or non-parametric!
Answers (1)
Aditya
on 25 Mar 2025
Hi Ehsan,
In MATLAB, the bootstrp function is used for bootstrapping, and it primarily implements non-parametric bootstrapping. Non-parametric bootstrapping involves resampling with replacement from the observed data, which does not assume any specific parametric form for the data distribution.
Here's a simple example demonstrating how to use bootstrp in MATLAB:
% Sample data
data = randn(100, 1); % Example dataset
% Function to compute the statistic (e.g., mean)
statFun = @(x) mean(x);
% Perform bootstrap
nBootstraps = 1000; % Number of bootstrap samples
bootstat = bootstrp(nBootstraps, statFun, data);
% Display results
fprintf('Bootstrap mean: %.4f\n', mean(bootstat));
fprintf('Bootstrap standard deviation: %.4f\n', std(bootstat));
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!