function [budget, cost, Lperror, maxerror] = NonlinearApprox(Wavelet_Coefficients,Dilations,Shifts,Budget,Kernel,Kernel_Parameter,TL_Smoothness,Approx_Norm,Time_End) %%Input Descriptions: %Budget - Total budget of centers; %Kernel - String: options 'Gauss' or 'MQ' %Kernel_Parameter - Gaussian exponent alpha, or MQ exponent alpha %TL_Smoothness - s value for Triebel-Lizorkin space (roughly # of %derivatives) %Approx_Norm - Lp norm for estimating difference of f and approximant %Wavelet_Coefficients - f_I coefficients of f in Meyer wavelet expansion %Dilations/Shifts - vectors containing dilations and shifts of unit cube %% here f = sum_j Wavelet_Coefficients_j*Meyer(2^(Dilations_j)*(x-Shifts_j))%% %%Initialize with Default Options: if nargin < 3 disp('Error: Must give a minimum of 3 arguments'); end if nargin < 4 || isempty(Budget) Budget = 20; disp('Budget assigned to be 20 centres'); end if nargin < 5 || isempty(Kernel) Kernel = 'Gauss'; disp('Kernel chosen to be the Gaussian with Parameter .5'); end %{ if nargin < 6 | (isempty(Kernel_Parameter) & isequal(strcmp(Kernel,'Gauss'),1)) Kernel_Parameter = .5; disp('Kernel_Parameter chosen to be .5 for the Gaussian kernel'); else Kernel_Parameter=-3/2; disp('Kernel_Parameter chosen to be -3/2 for the Multiquadric kernel'); end %} if nargin < 7 || isempty(TL_Smoothness) TL_Smoothness = 0; disp('Smoothness order chosen to be 0 by default'); end if nargin < 8 || isempty(Approx_Norm) Approx_Norm = 1; disp('Approximation norm chosen to be L_1 by default'); end if nargin < 9 || isempty(Time_End) Time_End = 6; disp('Interval in Time domain chosen to be [-6,6]'); end %%Preliminaries: Define Meyer mother wavelet in time (Meyer) and frequency %(Meyer_hat)%% f1 = @(x) 2*(sin(2*pi/3*(x+5/4))-sin(4*pi/3*(x+5/4)))./(pi*(4*x+5))+2*(sin(2*pi/3*(x-1/4))-sin(4*pi/3*(x-1/4)))./(pi*(4*x-1)); f2 = @(x) (cos(8*pi/3*(x+1/8))-cos(4*pi/3*(x+1/8)))./(2*pi*(x+1/8))+(cos(4*pi/3*(x+7/8))-cos(8*pi/3*(x+7/8)))./(2*pi*(x+7/8)); Meyer = @(x) f1(x)+f2(x); Meyer_hat = @(t) ((2*pi/3