SMp(x) Distribution Calculator
The SMp(x) distribution is a flexible six-parameter probability model that can approximate virtually any unimodal distribution, symmetric or skewed, narrow or wide. Enter the support bounds (PXmin and Xmax), the mode (ML), the two shape powers (p1 and p2), and an x value to evaluate. The calculator returns the density at x, the cumulative probability up to x, the probability in any interval, the analytical mean, variance and standard deviation, and an auto-normalized maximum. A density curve and step-by-step working are included.
What is the SMp(x) distribution?
The SMp(x) distribution is a six-parameter piecewise power function introduced by Anselmo (2019) as a single flexible model capable of reproducing virtually any unimodal probability distribution, whether continuous or discrete, symmetric or skewed, narrow or wide. The six parameters are: PXmin (the lower support boundary), Xmax (the upper support boundary), ML (the mode, where the density peaks), p1 (the power governing the left-side curvature from PXmin to ML), p2 (the power governing the right-side curvature from ML to Xmax), and Max (the peak density value). On the left segment, the density rises as a power function to the mode; on the right segment it falls as a power function back to zero. Setting p1 = p2 with the mode at the midpoint produces a symmetric distribution. Different combinations of the powers allow the researcher to dial in the exact shape needed for a given dataset or simulation.
How to use this calculator
Enter PXmin and Xmax as the left and right limits of the variable (the distribution is zero outside this range). Set ML to the most likely value, the point where you expect the peak density. Choose p1 and p2 to control shape: both equal to 1 gives a triangular distribution; values greater than 1 make the sides concave (bell-like); values between 0 and 1 make the sides convex (bathtub-like). The Max value is calculated automatically from the normalization condition, ensuring the total area under the curve equals 1, a requirement for a proper probability distribution. Enter an x value and select a probability mode to get the density at that point and the probability of falling below, above, or between chosen values. Results update as you type.
The SMp(x) formula explained
The piecewise definition is: SMp(x) = 0 for x below PXmin or above Xmax; on the left side, SMp(x) = ((x - PXmin) / (ML - PXmin))^p1 times Max; on the right side, SMp(x) = ((Xmax - x) / (Xmax - ML))^p2 times Max. The normalization condition that makes the area equal to 1 is Max = (p1+1)(p2+1) / [(p2+1)(ML - PXmin) + (p1+1)(Xmax - ML)]. The cumulative distribution function (CDF) has a closed form on each segment, which means tail and interval probabilities are exact rather than approximated by numerical integration.
Interpreting p1, p2 and the shape of the curve
p1 controls how steeply the density rises from PXmin to the mode ML. A value of 1 gives a straight linear rise; values above 1 make the rise concave (slow at first, then fast near the peak); values between 0 and 1 make the rise convex (fast at first, then slow). The same logic applies to p2 for the fall from ML to Xmax. When p1 and p2 differ, the distribution is skewed: a larger p2 relative to p1 makes the left tail heavier; a larger p1 relative to p2 makes the right tail heavier. To approximate the normal distribution, set p1 = p2 to a value above 1 and center the mode; the closer the mode is to the midpoint and the higher the equal powers, the more bell-shaped the curve becomes.
Common SMp(x) distribution shapes by parameter choice
| p1 | p2 | Mode position | Shape | Analogous distribution |
|---|---|---|---|---|
| 1 | 1 | center | Triangular (symmetric) | Triangular |
| 1 | 1 | left or right | Triangular (skewed) | Skewed triangular |
| >1 | >1 (equal) | center | Symmetric, concave sides | Normal (approx.) |
| <1 | <1 (equal) | center | Symmetric, convex sides | Arcsine-like |
| 1 | >1 | left of center | Left linear, right concave | Positive-skew |
| >1 | 1 | right of center | Left concave, right linear | Negative-skew |
| 1 | 1 | any | Uniform-like when p1=p2=1 and ML at midpoint | Uniform (limit) |
How p1, p2, and mode placement control the shape of the SMp(x) curve.
Frequently asked questions
What does the Max parameter represent and why is it auto-computed?
Max is the peak value of the SMp(x) density curve at the mode ML. For the function to be a proper probability distribution, the total area under the curve must equal exactly 1. Given PXmin, Xmax, ML, p1, and p2, there is exactly one value of Max that satisfies this condition: Max = (p1+1)(p2+1) / [(p2+1)(ML - PXmin) + (p1+1)(Xmax - ML)]. The calculator computes this for you automatically, so you never need to enter or adjust it manually.
How do I simulate a triangular distribution with SMp(x)?
Set p1 = 1 and p2 = 1. The SMp(x) then rises linearly from PXmin to ML and falls linearly from ML to Xmax, which is exactly a triangular distribution. If you also set ML = (PXmin + Xmax) / 2, you get a symmetric triangular distribution. Moving ML toward either endpoint makes it skewed left or right.
Can I use SMp(x) to approximate a normal distribution?
Yes. Set p1 = p2 to a value greater than 1 (commonly 2 to 5) and place ML at the midpoint of the support interval. Higher equal powers make the sides more concave and the peak narrower, producing a shape that visually resembles the normal bell curve within the bounded range. The approximation improves as p1 = p2 increases.
What is the difference between the density and the cumulative probability?
The density SMp(x) at a single point x tells you the relative likelihood of the variable taking a value close to x. It is not itself a probability (it can exceed 1 for narrow distributions). The cumulative distribution function F(x) = P(X <= x) gives the actual probability that a draw from the distribution falls at or below x. To find the probability of an interval, compute F(x2) - F(x1).
What happens if p1 or p2 equals zero?
The powers p1 and p2 must be strictly greater than zero. If either equals zero, the formula raises 0 to a power of 0 which is indeterminate, and the normalization condition breaks down. Values very close to zero (such as 0.01) are allowed and produce an almost-rectangular density spike concentrated near the support edge.
How do I use the interval probability mode?
Select "between two values" from the probability interval selector. Enter x1 as the lower limit and x2 as the upper limit. The calculator returns P(x1 <= X <= x2) = F(x2) - F(x1) using the closed-form CDF. This is exact for any valid x1 and x2 within the support.