need to roughly approximate a bell-curve according to given data

tchntm43

New member
Joined
Jan 8, 2020
Messages
36
Suppose I have the following values (these are variable in practice, so I'm just picking numbers for the example):
x = 15
f(15) = 50
d(deviation) = 10

I want to approximate a bell-curve where the center is at x = 15 with a y-value of 50, and the curve comes close to y-value of 0 at 15 +/- 10 (so at x=5 and x=25)

I thought perhaps a piece of a sine function might be the easiest way to do this, but I'm not sure how to make it fit the desired results. The way I'm writing the program, it won't calculate outside of the range x +/- d, so the rest of the sine function shouldn't be an issue. Other aspects of the shape of the bell-curve aren't important enough to worry about here.

It's important to be clear that I'm not creating a literal bell-curve in the technical sense (it's not a probability distribution from observed data points). I just need the approximate shape of one that fits the criteria.
 
Is this what you want?

1633485248596.png

I used a cosine, with amplitude 25 and period 20, shifted up 25 and right 15. Of course, I also had to restrict the domain.

[imath]y=25+25\cos\left(\frac{\pi}{10}\left(x-15\right)\right)[/imath]
 
Very interesting! I had started working on a function of type e^(.....) but that seems really good and far simpler code-wise. Will tinker with that a bit, thanks a lot.
 
Top