First of all: From what I understood, bootstrapping residuals works as follows:
- Fit model to data
- Calculate the residuals
- Resample the residuals and add them to 1.
- Fit model to new dataset from 3.
ntimes, but always add the resampled residuals to the fit from 1.
Is that correct so far?
What I want to do is something slightly different:
I want to estimate parameter and prediction uncertainty for an algorithm that estimates some environmental variable.
What I have is a error-free time-series (from a simulation) of that variable,
x_true, to which I add some noise,
x_noise, in order to generate a synthetic dataset
I then try to find optimal parameters by fitting my algorithm with the sum of squares
sum((x_estimate - x_true)^2) (! not
x_estimate - x !) as an objective function. In order to see how my algorithm performs and to create samples of my parameters' distributions, I want to resample
x_noise, add it to
x_true, fit my model again, rinse and repeat. Is that a valid approach to assess parameter uncertainty? Can I interpret the fits to the bootstrapped datasets as prediction uncertainty, or do I have to follow the procedure I posted above?
/edit: I think I haven't really made clear what my model does. Think of it as essentially something like a de-noising method. It's not a predictive model, it's an algorithm that tries to extract the underlying signal of a noisy time-series of environmental data.
/edit^2: For the MATLAB-Users out there, I wrote down some quick & dirty linear regression example of what I mean.
This is what I believe "ordinary" bootstrapping of residuals is (please correct me if I'm wrong): http://pastebin.com/C0CJp3d1
This is what I want to do: http://pastebin.com/mbapsz4c