% % Written by: % -- % John L. Weatherwax 2008-02-20 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- clear all; close all; drawnow; clc; addpath( '../../Code/eda_toolbox' ); randn('seed',0); M=200; x = linspace( 0, +1, M ); % our dependent function "y": % % -- a function that is IN the space of functions we are able to approximate i.e. a polynomial %y_truth = 4*x.^3 + 6*x.^2 - 1; % -- a function that is NOT in the space of functions we are able to approximate y_truth = 4*x.^5 + 6*x.^2 - 1 + (1./(x-1.1)); %y_truth = 4*x.^5 + 6*x.^2 - 1 + sin( 2*pi*x ); % create some noise to add to "y": sigma = 1.5; noise_eps = sigma*randn(size(y_truth)); y = y_truth + noise_eps; % plot the noised data: fd=figure; ho = plot( x, y, 'xr' );