MATLAB: Parametric bootstraping in curve fitting

parametric bootstraping

I like to use parametric bootstrapping technique to analyze the validity of a data set. The data set is the power received from an RFID tag. My aim is to develop a pathloss model. For this I have to fit the curve. But I want to use bootstrap technique to verify whether or not the collected data are okay. Is there any way to do this?

Best Answer

In general when I hear the expression parametric bootstrap I think "parametric residual bootstrap"
I'm attaching some simple code that contrasts and parametric and a non parametric residual bootstrap.
%%Bootstrap Examples
% Generate some data
x = 1:10000;
X = x';
Y = 3*X + 5 + randn(10000,1);
% Run a regression
b = regress(Y, [ones(size(X)), X])
%%Parametric residual bootstrap
% Appropriate if you have reason to believe that your residuals are

% normally distributed
YHat = [ones(size(X)), X] * b;
resid = Y - YHat;
foo = fitdist(resid, 'normal');
se = std(bootstrp(1000,@(bootr)regress(YHat+random(foo, size(bootr)),[ones(size(X)), X]),resid))
%%Nonparametric residual bootstrap
% Appropriate if you have reason to believe that your residuals are
% homoskedastic
YHat = [ones(size(X)), X] * b;
resid = Y - YHat;
se = std(bootstrp(1000,@(bootr)regress(YHat+bootr,[ones(size(X)), X]),resid))