Serving the Quantitative Finance Community

 
User avatar
erstwhile
Topic Author
Posts: 17
Joined: March 3rd, 2003, 3:18 pm

functional form of "hat functions"

November 5th, 2007, 4:05 pm

i can't remember the functional form of these functions that you use in the theory of distirbutions ...if you have a region equal to zero at and below X0 and also at and above X1, but equal to unity between X0+a and X1-a,then you can hook these regions together using a hat function that is continuous at X0 and X0+a, and is differentiable to all orders at all points.i used this in mathematical physics (functions having "compact support") in the mid 1980s and can't remember the functional forms of the hat functions.vaguely it was something like exponentials of ratios of some kind of function ...can anyone fill me in?thanks
 
User avatar
Cuchulainn
Posts: 22929
Joined: July 16th, 2004, 7:38 am

functional form of "hat functions"

November 5th, 2007, 4:18 pm

I used hat functions in FEM but these are piecewise polynomials of degree 1 (hence 'hat') and have compact support on a small interval [x-h, x+h] and they zero at the end points and equal to 1 at x. You can write a function as a linear combination of hat functions. But the exponential part is not clear, is this some kind of smoothing? It might be uniform in the middel with exponential tails. see your pm
Last edited by Cuchulainn on November 4th, 2007, 11:00 pm, edited 1 time in total.
 
User avatar
Alan
Posts: 3050
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

functional form of "hat functions"

November 5th, 2007, 4:54 pm

Try f(x) = exp -[(x - c)/(x-b)]^2 to connect your b = X0 and your c = X0+aregards, p.s. oops, this does not have d^n f/dx^n = 0 at x = c for all n >= 1, but will leave it until somebody posts the real answeranother try:f(x) = exp -[(x-b)^(-2) exp(-1/(x-c)^2)] = exp(h(x))We have f(b) = 0; f(c) = exp(0) = 1; (good)f'(x) = h'(x) f(x), so f'(b) = 0, f'(c) = h'(c) f(c) = 0; (good)f''(x) = [h''(x) + (h'(x))^2] f(x); so f''(b) = 0; f''(c) = [h''(c) + (h'(c))^2] f(c) = 0. (good)Looks promising to me.
Last edited by Alan on November 4th, 2007, 11:00 pm, edited 1 time in total.
 
User avatar
erstwhile
Topic Author
Posts: 17
Joined: March 3rd, 2003, 3:18 pm

functional form of "hat functions"

November 5th, 2007, 6:50 pm

Ah - got it ...F(x)=(A/a)exp[-a^2/(a^2-x^2)]F(x) is defined this way in the interval -a<x<+a and is taken to be zero outside this interval.All derivatives exist to all orders and at +/- a they vanish identically, assuming the value zero at these points.Very handy for smoothing out jumps when you have a root-finder!Thanks guys
 
User avatar
Cuchulainn
Posts: 22929
Joined: July 16th, 2004, 7:38 am

functional form of "hat functions"

November 5th, 2007, 8:24 pm

QuoteF(x)=(A/a)exp[-a^2/(a^2-x^2)]F(x) is defined this way in the interval -a<x<+a and is taken to be zero outside this interval.A mollifier! Indeed C infinity smooth on R(n) space and compact support.
Last edited by Cuchulainn on November 4th, 2007, 11:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Posts: 22929
Joined: July 16th, 2004, 7:38 am

functional form of "hat functions"

June 28th, 2009, 6:49 am

A belated post. The canonical mollifier (KO Friedrichs) in 1d and 2d are defined by the formula and useful for smoothing functions (even in sense of distributions). They might be useful..double mollifier(double x){ // Basis mollifier on [-1,1] double d = fabs(x); if (d < 1) { return exp(- 1.0/(1.0 - d*d)); } return 0.0;}double mollifier2D(double x, double y){ return mollifier(x) * mollifier(y);}
Last edited by Cuchulainn on June 27th, 2009, 10:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Posts: 22929
Joined: July 16th, 2004, 7:38 am

functional form of "hat functions"

June 28th, 2009, 6:59 am

Here is a graph of 2d smoothers
 
User avatar
Cuchulainn
Posts: 22929
Joined: July 16th, 2004, 7:38 am

functional form of "hat functions"

June 16th, 2013, 11:11 am

QuoteOriginally posted by: erstwhileAh - got it ...F(x)=(A/a)exp[-a^2/(a^2-x^2)]F(x) is defined this way in the interval -a<x<+a and is taken to be zero outside this interval.All derivatives exist to all orders and at +/- a they vanish identically, assuming the value zero at these points.EW and all,Let's say we have a linear polynomial p(x) (hat function)p(x) = 1 + x, for -1 <= x <= 0p(x) = 1 -x , for 0 <= x <= 1p(x) = 0 outside the interval [-1,1]Can we use the mollifier to smooth the kink at x = 0 and get a curve that is infinitely differentiable?An analytic formula for all values in [-1,1] would be ideal, or at least something that can easily be computed.
Last edited by Cuchulainn on June 15th, 2013, 10:00 pm, edited 1 time in total.