Bootstrap Techniques For Signal Processing

Appendix 1: MATLAB Codes for the Examples

A1.1 Basic Non-Parametric Bootstrap Estimation

Example 2.1.3: Bias estimation.
n=5;B=1000;MC=1000;X=randn(1,n);sigma2_u=var(X);sigma2_b=var(X,1);for m=1:MC,   X_star=bootrsp(X,B);   sigma2_star_u=var(X_star);   sigma2_star_b=var(X_star,1);   bias_u(m)=mean(sigma2_star_u-sigma2_b);   bias_b(m)=mean(sigma2_star_b-sigma2_b);end
Example 2.1.4: Variance estimation.
n=50;B=25;X=10+5*randn(1,n);X_star=bootrsp(X,B);theta_star=mean(X_star);sigma2_Boot=var(theta_star);
Example 2.1.5: Confidence interval for the mean.
X=[-2.41 4.86 6.06 9.11 10.20 12.81 13.17 14.10 ...   15.77 15.79];B=1000;alpha=0.05;X_star=bootrsp(X,B);mu_star=mean(X_star);mu_sort=sort(mu_star);q1=floor(0.5*B*alpha);q2=N-q1+1;conf_inter=[mu_sort(q1),mu_sort(q2)];

A1.2 The Parametric Bootstrap

Example 2.1.6: Confidence interval for the mean (a parametric approach).
X=[-2.41 4.86 6.06 9.11 10.20 12.81 13.17 14.10 ...   15.77 15.79];hat_mu=mean(X);hat_sigma=std(X);n=10;B=1000;alpha=0.05;X_star=hat_mu+hat_sigma*randn(n,B);mu_star=mean(X_star);mu_sort=sort(mu_star);q1=floor(0.5*B*alpha);q2=B-q1+1;conf_inter=[mu_sort(q1),mu_sort(q2)];

A1.3 Bootstrap Resampling for Dependent Data

Example 2.1.9: Variance estimation in AR models.
n=128;B=1000;a=-0.6;Zt=randn(1,n);X=filter(1,[1 a],Zt);X=X-mean(X);c0=mean(X.^2);c1=mean(X(1:n-1).*X(2:n));ahat=-c1/c0;zt=filter([1 ahat],1,X);zt_star=bootrsp(zt,B);X_star=filter(1,[1 ahat],zt_star);X_star(:,1)=X(1);c0_star=mean(X_star.^2);c1_star=mean(X_star(1:n-1,:).*X_star(2:n,:));ahat_star=-c1_star./c0_star;sigma2_star=var(ahat_star);

A1.4 The Principle of Pivoting and Variance Stabilisation

Example 2.2.1: Confidence interval for the mean with a pivotal statistic.
X=[-2.41 4.86 6.06 9.11 10.20 12.81 13.17 14.10 ...   15.77 15.79];B=1000;B1=25;alpha=0.05;hat_mu=mean(X);X_star1=bootrsp(X,B1);mu_star1=mean(X_star1);hat_sigma=std(mu_star1);X_star=bootrsp(X,B);hat_mu_star=mean(X_star);hat_mu_Y_star=zeros(1,B);for k=1:N,   % Nested bootstrap   X_star_star=bootrsp(X_star(:,k),B1);   hat_mu_star_star=mean(X_star_star);   hat_sigma_star=std(hat_mu_star_star);   hat_mu_Y_star(k)=(hat_mu_star(k)-hat_mu)/ ...                     hat_sigma_star;endmu_Y_sort=sort(hat_mu_Y_star);q1=floor(0.5*B*alpha);q2=N-q1+1;conf_inter=[hat_mu-hat_sigma*mu_Y_sort(q2), ...            hat_mu-hat_sigma*mu_Y_sort(q1)];
Example. The principle of variance stabilisation.

Below we show a MATLAB routine that illustrates how the variance stabilisation is estimated (see Section 2.2). We use the sample mean as a statistic . The function smooth.m used below is a running line smoother that fits the data by linear least squares as described in Hastie and Tibshirani (1990) (see Appendix 2).

n=50;B1=100;B2=25;B3=1000;X=randn(1,n);theta=mean(X);X_star=bootrsp(X,B1);theta_star=mean(X_star);for k=1:B1,   X_star_star=bootrsp(X_star(:,k),B2);   theta_star2=mean(X_star_star);  ...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Thermopiles
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.