Saturday 7 February 2015

A Well-Behaved Bell Curve For Mathematical Models

Often, when developing mathematical models, I need a bell curve-like function, somthing like the Gaussian bell curve. But I want a simple one; one that conforms to certain requirements, which makes its use somewhat sensible. Now, mind you, I don't mean to apply this function to the domain of statistics - that domain certainly belongs to the Gaussian bell curve and there is nothing wrong with it. I just don't particularly like all of its properties in the context of a well-defined mathematical model.

This is what the target function looks like:

Properties

From very far away, this function looks somwhat similar to a Gaussian bell curve in that it features one maximum and falls off symmetrically to both sides. But it has a few properties, that make it very useful in constructing mathematical models. Most importantly, and this is the main difference from the Gaussian curve, the function reaches 0 on both sides of the bell. More specifically, it has:
  • a value of 0 for x ≤ -0.5.
  • a value of 0 for x ≥ 0.5.
  • a maximum at x = 0 with a value of 1.
  • an inflection point at x = -0.25.
  • an inflection point at x = 0.25.

Solution


Disclaimer: I'm a proponent of τ (= 2 π), so I will use it in my definitions.

The basis for my suggestion is the cosine function with some modifications to stretch it into the target area and a cut-off to the left and right as to break the periodic behaviour. In Mathematica terms, it can be defined as follows:

Extensions

1. Amplitude

It can easily be scaled to reach any amplitude at the maximum by multiplying it with that maximum value like this:
In the simple version this parameter effectively defaults to 1. Here are two examples for a = 1.8 and a = -2.5 respectively:

2. Width

It is also possible to widen or narrow the curve using a width argument. The width is given between the two points where the bell curve reaches zero and defaults to 1 in the simple version:
Here are two examples for w = 4.8 and w = 0.6, respectively:

3. Offset

To move the function to the left or right, you can use an offset argument. The value of the offset specifies the position of the maximum and therefore defaults to 0 in the simple version.

Here are two examples for o = -2 and o = 0.2, respectively:

General Combination

Of course, the three extensions mentioned above are orthogonal and can be combined any way you like. This is the definition of the general function supporting all three ways to modify the bell curve:
Here are two examples. One has an amplitude of 0.1, a width of 6 and an offset of 1.5. The other one has an amplitude of -1.2, a width of 0.4 and an offset of -0.8.

No comments:

Post a Comment