2
$\begingroup$

I have a data sample (in this case an EEG data sample, but my question refers to any type of data samples of prior unknown distributions).

I would like to do a nonparametric estimate of the expected value for my sample. I did some research, from what I understood I can do this using bootstrap sampling. I found a pdf here giving a formula for bootstrap expected value, hopefully it's correct.

In case it's not, can someone please let me know how to do it once I have generated the samples by bootstrapping?

Another possibility seems to be MCMC, but I would need to know the distribution from what I understood. I could do a kernel density estimation probably, but I think using bootstrapping might be less complex?

I can use python, Matlab or R, in case you do this kind of thing often and have code at hand to share, I'd really appreciate it.

Any other methods/suggestions are more than welcome.

$\endgroup$
2
$\begingroup$

It is quite simple; you make a subsample by sampling with replacement:

sample(x,replace=T)

calculate the statistic you want on it:

mean(sample(x,replace=T))

finally average it over many repetitions:

mean(replicate(1000,mean(sample(x,replace=T)))
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy