function [y,t,n_std]=hw2_generate_Y(example); if example == 1 % Generate true signal t=[1:50]'; N=length(t); % Generate Gaussian Random Noise with zero mean and variance=9. n_std=3; n = bs_rand('norm', [0, 1 ], N, 1); n = n-mean(n); n = n_std*n/std(n); y=1+2*t+n; end if example == 2 % Generate true signal t=[1:50]'; N=length(t); % Generate Gaussian Random Noise with zero mean and variance=9. n_std=30; n = bs_rand('norm', [0, 1 ], N, 1); n = n-mean(n); n = n_std*n/std(n); y=1+2*t+n; end if example == 3 % Generate true signal t=[1:20]'; n_std=30; N=length(t); % Generate Gaussian Random Noise with zero mean and variance=9. n = bs_rand('norm', [0, 1 ], N, 1); n = n-mean(n); n = n_std*n/std(n); y=1 + 2*t.^2 + n; end if example == 4 % Generate true signal t=[1:50]'; n_std=30; N=length(t); % Generate Gaussian Random Noise with zero mean and variance=9. n = bs_rand('norm', [0, 1 ], N, 1); n = n-mean(n); n = n_std*n/std(n); y=1 + 2*t.^2 + n; end if example == 5 % Upload Keeling Curve load CO2.mat t=[1:length(co2)]'; y=co2(~isnan(co2)); t=t(~isnan(co2)); n_std=1; N=length(t); end