Functions

For the discussion of math. Duh.

Moderators: gmalivuk, Moderators General, Prelates

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

Functions

Postby Radium » Sat Aug 27, 2011 5:15 am UTC

This is just a quick question.

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

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

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

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?

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

Re: Functions

Postby Sizik » Sat Aug 27, 2011 5:19 am UTC

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.

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

Re: Functions

Postby Radium » Sat Aug 27, 2011 5:26 am UTC

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. :)

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

Re: Functions

Postby Qaanol » Sat Aug 27, 2011 5:50 am UTC

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

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

Re: Functions

Postby Radium » Sat Aug 27, 2011 6:03 am UTC

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

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

Re: Functions

Postby Sagekilla » Sat Aug 27, 2011 6:13 am UTC

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):
Image

f(x + 3):
Image

f(x / 2):
Image
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.

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

Re: Functions

Postby Qaanol » Sat Aug 27, 2011 6:40 am UTC

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

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

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

Re: Functions

Postby Radium » Sat Aug 27, 2011 7:13 am UTC

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.

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

Re: Functions

Postby Qaanol » Sat Aug 27, 2011 3:18 pm UTC

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

Postby mfb » Sat Aug 27, 2011 3:22 pm UTC

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.

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

Re: Functions

Postby Qaanol » Sat Aug 27, 2011 3:33 pm UTC

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

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

Re: Functions

Postby Radium » Sat Aug 27, 2011 4:19 pm UTC

These are all awesome, thanks :D


Return to “Mathematics”

Who is online

Users browsing this forum: Alexa [Bot] and 12 guests