Log in

View Full Version : Bell curve (gauss function)



CX gamer
07-30-2010, 06:23 PM
Hi,

Does anyone know the formula for a function of which when the x-axis is a random linear number between left_bound and right_bound, the function for the chance of having an Y-value equals a bell curve AKA gauss function?

In other words, part of an inverted gauss function. It should look like this;
http://a.imageshack.us/img716/3081/function.png

That would be awesomum maximus. Also, with the formula of the previous, I should be able to get this one too;
http://a.imageshack.us/img651/6716/otherfunction.png

I'm kinda throwing an attempt to rewrite a core function of SRL. I hope this will work. :)

Cstrike
07-30-2010, 06:32 PM
Sorry I dont follow :(

Are you trying to get the input of an X value and turn it into a Y value?

If you want an equation for the bottom graph I can get a ton for you if that's what you mean. Sorry if I don't follow. I got woken up 3x last night and I'm so tired :( Maybe this will be of some help though

Cigue
07-30-2010, 07:49 PM
Hi,

Does anyone know the formula for a function of which when the x-axis is a random linear number between left_bound and right_bound, the function for the chance of having an Y-value equals a bell curve AKA gauss function?

In other words, part of an inverted gauss function. It should look like this;
http://a.imageshack.us/img716/3081/function.png

That would be awesomum maximus. Also, with the formula of the previous, I should be able to get this one too;
http://a.imageshack.us/img651/6716/otherfunction.png

I'm kinda throwing an attempt to rewrite a core function of SRL. I hope this will work. :)

I don't get the second one, but would the first one be the d/dx of a gaussian formula?

http://serge.mehl.free.fr/chrono/chrono_gif/Gauss4a.gif

Killerdou
07-30-2010, 09:02 PM
the second one maybe something like:

ax*e^(bx) with a > 0 and b < 0
I can't help it but it looks A LOT like the phi(r) of the 2p orbital....

Dan Cardin
07-30-2010, 09:23 PM
isnt the first one just a variant of x^3?

i luffs yeww
07-30-2010, 09:27 PM
http://i28.tinypic.com/sbogfb.gif

Yes.

CX gamer
07-30-2010, 10:29 PM
cstrike, I know what you're talking about.. I'm mailman, I need to get up at 4:30, I'm always tired. :(

Cigue, the d/dx of the gaussian formula would look nothing like the function I need. :(
The one I need is when you take a guassian function and invert it (turn it to it's side), and take half of that (since it can only have 1 Y-value for each X-value).

Killerdou, the second one should just be a logaritmic scale applied to the x of a standard normal function (or a guassian function). Your function doesn't share the same shape. :(

Dan Cardin, I wish it was that simple. And I have thought of that too, and I didn't think it would work as it is a very different function. But hence the lack of a better solution, I will be testing a x³ function if it matches the gaussian curve I need. :)

Thank you all for your replies. :D

Nava2
07-30-2010, 11:56 PM
http://mathbin.net/equations/50459_0.png

I started to calculate the inverse, but it appears as though it goes into the complex plane. Which I don't think you really wanted..

Killerdou
07-31-2010, 08:38 AM
It does have a similar shape(of what you drew) if you choose the right a and b (try plotting a = 100 and b = -10) However... exactly what are you trying to do with this? Making a new random function?

CX gamer
07-31-2010, 09:21 AM
Thanks Nava for your effort. Yes, I'd favourably stay out of the complex plane.

Killerdou, you have guessed right. I am trying to make a human-like random function, which can be used to improve MMouse. I've figured that a human's mouse movement works in pulses. I have plotted some here, these use 10 ms intervals.
http://a.imageshack.us/img375/9711/speedf.png
You can see that the initial pulse takes just about the reaction speed of a human to an expected event (200-250 ms), that is why I would need the second graph.
But that was not my main problem, I really need the first one. :P

Thank you for your replies, all. I will be trying out the x³ and your function now. :)

i luffs yeww
07-31-2010, 09:31 AM
May I ask why exactly you're doing this?

The Claw
07-31-2010, 09:36 AM
Python would be perfect for this

CX gamer
07-31-2010, 09:43 AM
May I ask why exactly you're doing this?
Improving a linear random function to a human-like random.

CX gamer
07-31-2010, 10:39 AM
Great! Dan Cardin was right! I can use that kind of function to generate a gauss function :D
This graph was generated using 0.2x+0.8*x^5 with 10k values;
http://a.imageshack.us/img46/2413/10ks.png

Thanks all. :D

Dan Cardin
07-31-2010, 12:31 PM
i win. The simplest answer is always less wrong!