Minimax approximation on discrete interval with Chebfun?

37 views
Skip to first unread message

Dongwoo Kim

unread,
Jul 4, 2019, 3:48:16 AM7/4/19
to chebfun-users
untitled3.jpguntitled7.jpguntitled5.jpg


Can we use minimax of Chebfun to approximate certain functions on discrete interval?

For example, assume we want to approximate the function sign(x) : = 1 (if x > 0) -1 (if x < 0).

In that case, we should restrict the approximation interval to be [-1, -\epsilon] \union [\epsilon, 1] for some \epsion > 0.

If not, the minimax approximation always gives a polynomial f(x) whose uniform difference from sign(x) is 2. (See the figures.)


However, I can not find the way to make minimax of Chebfun to be work over the discrete interval.

I looked the code file (chebfun.m and minimax.m), but the comment says that chebfun (or minimax function) is only defined over an interval.

Is there any way to solve this problem? 

Thank you.

Quentien Edouard Gendron

unread,
Aug 1, 2023, 5:47:01 PM8/1/23
to chebfun-users
I have exactly the same question than Dongwoo Kim. Is there a way to make approximation of a function defined on two (or more) disjoint intervals?
Thanks in advance.

nakatsu...@gmail.com

unread,
Aug 6, 2023, 9:27:07 AM8/6/23
to chebfun-users
Dear Quentien and Dongwoo (for a reply after a 4-year wait!)

For polynomial approximation in nonstandard domains, we would suggest Vandermonde with Arnoldi
https://people.maths.ox.ac.uk/trefethen/vandermonde.pdf
for which code is available in the paper. One can combine it with Lawson iterations to get a minimax approximant. Below is an example code and output.

ep = 0.1;
N = 1000; % #samples
n = 40; % degree

x = linspace(ep,1,N); x = sort([-x x]); % domain is [-1 -ep] cup [ep 1]
x = x(:); % x is a vector of sampled values in the domain

f = @(x)sign(x); F = f(x);

[d,H,Q] = polyfitA_Lawson(x,F,n); % core bit, polyfitA as in paper plus Lawson iterations. 
p = @(y) polyvalA(d,H,y);

plot(x,f(x)-p(x)),shg, grid on

% p is a polynomial. if necessary, one form chebfun equal to p by: p = chebfun(@(x)p(x));

I hope this helps.
Yuji


sign_polyLawson.png
polyfitA_Lawson.m
polyvalA.m
Reply all
Reply to author
Forward
0 new messages