## Functions

For the discussion of math. Duh.

Moderators: gmalivuk, Moderators General, Prelates

Posts: 15
Joined: Thu Aug 18, 2011 3:13 am UTC

### Functions

This is just a quick question.

The following an example of a sigmoid function with the form y=(1/(1+e^(-x))):

The following is an example of a gaussian of the form y=e^(-x^2):

I'm looking for a function that basically looks like this:

Such that it approaches 0 three times, one of them being at the origin of the Cartesian plane, as well as approaching 1 at -a/2 and a/2.
Does anyone have any ideas what such a function could be?

Sizik
Posts: 1260
Joined: Wed Aug 27, 2008 3:48 am UTC

### Re: Functions

Can it pass through 0?
she/they
gmalivuk wrote:
King Author wrote:If space (rather, distance) is an illusion, it'd be possible for one meta-me to experience both body's sensory inputs.
Yes. And if wishes were horses, wishing wells would fill up very quickly with drowned horses.

Posts: 15
Joined: Thu Aug 18, 2011 3:13 am UTC

### Re: Functions

Beyond arbitrary point (a,0) and (-a,0), it can do whatever the hell it wants. The only important thing is that from (a,0) and (-a,0) it looks like the image.

Qaanol
The Cheshirest Catamount
Posts: 3069
Joined: Sat May 09, 2009 11:55 pm UTC

### Re: Functions

Well sin2(πx/a) works if you want it to oscillate.
wee free kings

Posts: 15
Joined: Thu Aug 18, 2011 3:13 am UTC

### Re: Functions

Thanks
However, is there one which has a horizontal asymptote at 0? I just realized that I was wrong.

Sagekilla
Posts: 382
Joined: Fri Aug 21, 2009 1:02 am UTC
Location: Long Island, NY

### Re: Functions

Can't you just define it piecewise? There's nothing wrong with saying:

For -1 <= x <= 1:
f(x) = sin(pi * x)^2

Otherwise:
f(x) = 0

Old stuff:
Spoiler:
Define f(x) = x^2 * exp(1 - x^2)

The function f(x / a) does exactly what you want. It goes to zero at infinity, has three zeros at: x = 0, x = -a, x = +a.

Well, f(2 * x / a) gives you the zeros at -a / 2 and +a / 2. But still.

Bonus: It has an indefinite integral of a * exp(1) * sqrt(pi) / 2 over the whole x-axis.
Double bonus: the function f((x + y) / a) is the same, but translated so the "middle" zero occurs at x = -y.

Obligatory images below:

f(x):

f(x + 3):

f(x / 2):
http://en.wikipedia.org/wiki/DSV_Alvin#Sinking wrote:Researchers found a cheese sandwich which exhibited no visible signs of decomposition, and was in fact eaten.

Qaanol
The Cheshirest Catamount
Posts: 3069
Joined: Sat May 09, 2009 11:55 pm UTC

### Re: Functions

However, is there one which has a horizontal asymptote at 0? I just realized that I was wrong.

Yes there is. What is this for? What work have you already done on it?
wee free kings

Posts: 15
Joined: Thu Aug 18, 2011 3:13 am UTC

### Re: Functions

This is for the activation function of a neural network. I'm trying to optimize an image recognition neural network, and I'm messing around with some functions.

Qaanol
The Cheshirest Catamount
Posts: 3069
Joined: Sat May 09, 2009 11:55 pm UTC

### Re: Functions

One option is a Chi distribution, for example with k=3, then scaled and shifted to meet your criteria, there’s 4(x/a)2e1-4(x/a)².

Another is what I’m calling a logarithmic Gaussian, e-(ln |2x/a|)². Or perhaps, e-(ln[4(x/a)²])².
Last edited by Qaanol on Sat Aug 27, 2011 3:30 pm UTC, edited 1 time in total.
wee free kings

mfb
Posts: 950
Joined: Thu Jan 08, 2009 7:48 pm UTC

### Re: Functions

Another idea:
a^2/2 * x^2/((a/2)^4+x^4)
Already scaled to have a maximum of 1 at +-a/2

Edit: My link to WolframAlpha does not work, just copy it with some value a to see a graph.

The nominator and the denominator can get some exponents, so you can use
c*(x^2)^n/(d+x^4)^m with proper c,d for the maxima.

Qaanol
The Cheshirest Catamount
Posts: 3069
Joined: Sat May 09, 2009 11:55 pm UTC

### Re: Functions

mfb wrote:Another idea:
a^2/2 * x^2/((a/2)^4+x^4)
Already scaled to have a maximum of 1 at +-a/2

Edit: My link to WolframAlpha does not work, just copy it with some value a to see a graph.

The nominator and the denominator can get some exponents, so you can use
c*(x^2)^n/(d+x^4)^m with proper c,d for the maxima.

That’s because you needed to use this link to WolframAlpha.
wee free kings