A smpx distribution calculator evaluates the SMp(x) function, a probability density with a lower bound, an upper bound, a mode and two powers. Enter the six parameters and a point x, and the calculator gives the value at that point, the area under the curve and the peak height that makes the area 1.
How to use the smpx distribution calculator
- Enter the lower bound, the upper bound and the mode.
- Enter the powers p1 and p2 and the peak height Max.
- Enter the point x.
- Press Calculate.
What SMp(x) is
SMp(x) is a probability density with a minimum, a maximum, a mode and two powers. It resembles the triangular distribution, which also has a lower limit, an upper limit and a mode, rises to the mode and falls after it [1]. Here the function rises from the lower bound to the mode and falls from the mode to the upper bound, like a tent whose sides can be curved by the powers.
The formula
This tool uses the function in pieces. SMp(x) is 0 for x below the lower bound PXmin. From PXmin to the mode ML it equals ((x − PXmin) ÷ (ML − PXmin)) raised to the power p1, times Max. From ML to the upper bound Xmax it equals ((Xmax − x) ÷ (Xmax − ML)) raised to the power p2, times Max. For x above Xmax it is 0. We treat p1 and p2 as the exponents on the two sides. With both powers equal to 1 the sides are straight and the shape is the triangular density [1].
The parameters
PXmin and Xmax are the limits of the values that can occur. ML, the mode, is the point where the function reaches its peak, which is the value Max. The powers p1 and p2 must be above 0. A power of 1 gives a straight side, a power above 1 makes the side sag below the straight line and a power below 1 makes it bulge above it. That description of the shapes is our own working. Max must also be above 0.
A worked example
This example is our own. Take PXmin 62, Xmax 107, ML 84.5, p1 and p2 both 2, and Max 0.066667, which is 3 divided by 45. For x = 75 the rising piece applies. The distance from the lower bound is 13, the width of the rising side is 22.5, and (13 ÷ 22.5) squared is 0.33383. Times 0.066667, that gives 0.022255, which the tool shows.
The area under the curve
A probability density has a total area of 1 [2]. For equal powers and a mode at the midpoint, that condition gives Max = (p1 + 1) ÷ (2 × (ML − PXmin)), which is our own working. The general area is also our own derivation. Each piece is a power curve, so its area is its width divided by the power plus one, times Max: Max × [(ML − PXmin) ÷ (p1 + 1) + (Xmax − ML) ÷ (p2 + 1)].
The peak height for an area of 1
Setting the area to 1 and solving for Max gives 1 divided by the bracket: 1 ÷ [(ML − PXmin) ÷ (p1 + 1) + (Xmax − ML) ÷ (p2 + 1)]. That is our own working, and the tool shows it as the peak height for an area of 1. In the worked example the bracket is 22.5 ÷ 3 + 22.5 ÷ 3 = 15, so Max = 0.066667, and the area is exactly 1. The midpoint formula above gives the same value there.
Points outside the bounds
If x is below PXmin or above Xmax, the function is 0, and the tool tells you which side you are on. If x equals the mode, both pieces give Max, so the tool says so. If the mode is equal to one of the bounds, one piece has no width. The tool then avoids a division by zero, and the value at the bound is Max. A mode outside the two bounds is not allowed.
Checking the peak height
Compare two cases. With the placeholders in the boxes, which use a mode of 84.5, the calculator gives a density of 0.022 at x = 75, and an area close to 1. With a mode of 85, powers of 2 and a Max of 0.04, the area is 0.6, so that Max would not be a true density.
What this tool does not cover
This tool does not compute the probability of a range, the mean or special cases. The tool evaluates the function, and gives the area and the peak height for an area of 1. For the probability of a range, you would have to take the area under the curve over that range.
Using the results
Compare the area with 1 to see whether your Max suits the other parameters. If it does not, enter the suggested peak height and run it again. Then change x to read the function at other points. Because the function is a density, a value is not itself a probability. The probability of a range is the area under the curve over that range [2], which is beyond this calculator.
Common mistakes
- Treating the value as a probability. It is a density, not a probability.
- Choosing a mode outside the bounds. The mode must lie between them.
- Using a power of 0 or less. Both powers must be above 0.
- Assuming an area of 1. Check the area, or use the suggested peak height.
What next
Use this often? Add SMpx Distrib to your Home screen.
Frequently asked questions
What is a smpx distribution calculator?
A tool that evaluates the SMp(x) probability density function at a point, given its bounds, mode, two powers and peak height.
What is the SMp(x) formula?
It is 0 outside the bounds, ((x − PXmin) ÷ (ML − PXmin)) to the power p1 times Max up to the mode, and ((Xmax − x) ÷ (Xmax − ML)) to the power p2 times Max after it.
How do I make the area equal 1?
Use the peak height the calculator suggests, which is 1 divided by the sum of the two width terms.
Is the value a probability?
No. It is a density. A probability is the area under the curve over a range.
Can the mode equal a bound?
Yes. The calculator then gives Max at that bound and 0 outside.
Was this tool helpful?
What went wrong?
We only receive the reason you pick, never what you typed into the tool.
Thanks for your feedback.