Statistics & probability

Truncated normal distribution fit calculator from bounded samples

Fit the latent mean and standard deviation of a normal distribution observed only inside a known finite interval.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Fit the latent mean and standard deviation of a normal distribution observed only inside a known finite interval. Every entered sample is conditioned on falling strictly between those bounds. The likelihood includes the interval's Gaussian probability mass, so this calculation differs from simply taking the mean and standard deviation of the retained observations. It estimates latent Gaussian parameters, not the moments of the bounded sample itself.

THE FORMULAf(y|l<Y<u)=φ((y−μ)/σ)/[σ(Φ((u−μ)/σ)−Φ((l−μ)/σ))].

A worked example

The prefilled sample is symmetric around zero within the fixed window (−2,2), so the fitted latent mean is zero. The fitted latent standard deviation differs from the observed sample spread because the likelihood renormalizes by the probability of falling inside the sampling window.

Good to know

10–300 strict-interior observations; known finite bounds. Three local starts with approximate normal CDF; tiny retained mass and unresolved boundary parameters rejected. Latent parameters are estimates, not mean/SD of the truncated sample; no censoring model or confidence intervals.

What conditioning on selection changes

Truncation means observations outside the interval are absent. The density of each retained value is the ordinary Gaussian density divided by the probability of entering the interval.

That denominator depends on both latent parameters and cannot be dropped during estimation. A symmetric narrow sampling window can make a broad normal distribution look almost flat. Knowing the selection rule is essential; a fitted correction cannot determine whether the missing observations were actually selected in this way.

A truncation window retains only the central observed sample−22Missing tailsObserved mean: 0Latent spread fitted
The prefilled sample is symmetric around zero within the fixed window (−2,2), so the fitted latent mean is zero. The fitted latent standard deviation differs from the observed sample spread because the likelihood renormalizes by the probability of falling inside the sampling window. Static schematic; numerical labels define the example.

Corrects the likelihood for selection/truncation; existing normal probability calculations take parameters as known. The Capture recapture population estimate calculator from two samples offers a complementary calculation under its own stated assumptions.

Supplying fixed truncation bounds

Use the externally known lower and upper selection limits rather than setting the bounds equal to the smallest and largest observed values. Each observation must lie strictly inside the interval.

The tool rescales the interval internally to improve numerical conditioning, but returned mean and scale use the original units. Values at a reporting limit may indicate censoring or rounding, which is a different observation model. Investigate that distinction before deleting or nudging boundary observations.

Worked example and mathematical rule

The prefilled sample is symmetric around zero within the fixed window (−2,2), so the fitted latent mean is zero. The fitted latent standard deviation differs from the observed sample spread because the likelihood renormalizes by the probability of falling inside the sampling window.

f(y|l<Y<u)=φ((y−μ)/σ)/[σ(Φ((u−μ)/σ)−Φ((l−μ)/σ))].

Latent parameters versus observed moments

The fitted latent mean can lie outside the observed interval because only one tail of the Gaussian population may have been retained. Its standard deviation can also exceed the sample's spread.

Neither is automatically an error. Conversely, a finite numerical answer is not proof that the latent population is well identified. When the visible density is nearly monotone or nearly uniform, very different latent parameter combinations may fit almost equally well.

Numerical search and weak identification

The implementation uses several starting points and retains the best supported local solution. It rejects parameter boundaries and poorly resolved broad-tail fits instead of presenting them as precise population estimates.

It does not calculate a likelihood profile or confidence intervals. If an analysis depends strongly on an inferred mean far outside the sampling window, assess uncertainty with a fuller statistical workflow. Increasing the numerical iteration count cannot replace information excluded by a narrow selection interval.

Assumptions behind the correction

The parent population must be adequately described by a normal distribution, and inclusion must depend only on the stated fixed interval. Preferential sampling within the interval, varying limits across observations or a mixture of populations changes the likelihood.

Treating a naturally bounded variable as a truncated normal can be a convenient approximation, but that is a modeling choice rather than a recovery of an existing unbounded population. Document why a Gaussian parent distribution is plausible.

Checking a result in context

Compare the fitted latent parameters with the raw sample moments, and explain why they differ. Translate the interval into fitted standardized bounds to see whether it covers the center or only a tail.

Repeat the calculation after a legitimate change of measurement units: the mean and standard deviation should transform accordingly. Do not widen the interval merely to obtain a more comfortable answer. The selection window is part of the data-generating process and must remain anchored to how observations were actually collected.

A few questions, answered

Can the fitted mean be outside the bounds?

Yes. The mean belongs to the latent untruncated Gaussian population.

Should I use sample minimum and maximum as bounds?

Only if those were the actual prespecified selection limits; observed extremes alone do not establish truncation.

Does this handle censored boundary records?

No. Censored records contribute tail masses and need a censored-regression or censored-distribution likelihood.

Why might a fit be rejected?

A narrow or poorly informative window can leave latent location and scale numerically unresolved.

Find your calculator

Start typing to explore the library.