SplicedDistribution[{w1,w2,…,wn},{c0,c1,…,cn},{dist1,dist2,…,distn}]
represents the distribution obtained by splicing the distributions dist1, dist2, … truncated on the intervals {c0,c1}, {c1,c2}, … with weights w1, w2, … .
SplicedDistribution
SplicedDistribution[{w1,w2,…,wn},{c0,c1,…,cn},{dist1,dist2,…,distn}]
represents the distribution obtained by splicing the distributions dist1, dist2, … truncated on the intervals {c0,c1}, {c1,c2}, … with weights w1, w2, … .
Details
- SplicedDistribution is equivalent to MixtureDistribution[{w1,w2,…},{TruncatedDistribution[{c0,c1},dist1],…}].
- The distributions dist1, dist2, … need to be all continuous univariate distributions.
- The weights wi can be any non-negative real numbers.
- The interval limits
can be any real numbers such that
. - SplicedDistribution can be used with such functions as Mean, CDF, and RandomVariate, etc.
Examples
open all close allBasic Examples (2)
Define a spliced distribution with a normal body and a Pareto tail:
𝒟 = SplicedDistribution[{1 / 3, 2 / 3}, {0, 9, ∞}, {NormalDistribution[1, 4], ParetoDistribution[2, 1 / 8]}];Plot[PDF[𝒟, x]//Evaluate, {x, 0, 12}, Filling -> Axis, Exclusions -> None]PDF[𝒟, x]Find the mean and variance of a spliced distribution:
𝒟 = SplicedDistribution[{1, 2}, {1, 2, 3}, {ExponentialDistribution[.2], ExponentialDistribution[3]}];{Mean[𝒟], Variance[𝒟]}Compare with the values obtained by using a random sample:
data = RandomVariate[𝒟, 10 ^ 4];{Mean[data], Variance[data]}Scope (4)
Add symmetric exponential tails to normal distribution:
dist1 = LaplaceDistribution[0, 3];
dist2 = NormalDistribution[0, 2];
𝒟 = SplicedDistribution[{1, 1, 1}, {-∞, -1, 1, ∞}, {dist1, dist2, dist1}];Table[Plot[fun[𝒟, x], {x, -5, 5}, Filling -> Axis, Exclusions -> None, PlotLabel -> fun], {fun, {PDF, CDF, HazardFunction, SurvivalFunction}}]Since distribution is symmetric, all odd moments are 0:
{Mean[𝒟], Skewness[𝒟], Moment[𝒟, 45]}Variance[𝒟]//NKurtosis[𝒟]//NCreate a Student
distribution with a heavier right tail:
𝒹 = StudentTDistribution[3];
𝒟 = SplicedDistribution[{1 / 4, 3 / 4}, {-∞, 0, ∞}, {𝒹, 𝒹}];Plot[PDF[𝒟, x], {x, -5, 5}, Filling -> Axis]Generate a set of pseudorandom numbers that follow this distribution:
sample = RandomVariate[𝒟, 10 ^ 3];Compare the histogram of the sample to the PDF:
Show[Histogram[sample, {-5, 5, .5}, "PDF"], Plot[PDF[𝒟, x], {x, -5, 5}, PlotStyle -> Thick]]Generate a set of pseudorandom numbers following lognormal distribution with exponential tails:
𝒟 = SplicedDistribution[{1, 1, 1}, {0, 1, 2, 10}, {LogNormalDistribution[0, 1], ExponentialDistribution[λ], ExponentialDistribution[μ]}];sample = Block[{λ = 1.8, μ = 1}, RandomVariate[𝒟, 10 ^ 3]];edist = EstimatedDistribution[sample, 𝒟]Compare the histogram of the sample with the PDF:
Show[Histogram[sample, {0, 8, .2}, "PDF"], Plot[PDF[edist, x], {x, 0, 8}, PlotStyle -> Thick]]Splicing QuantityDistribution with compatible units yields QuantityDistribution:
d1 = NormalDistribution[Quantity[0, "Centimeters"], Quantity[1, "Centimeters"]];
d2 = QuantityDistribution[StudentTDistribution[9], "Feet"];𝒟 = SplicedDistribution[{1, 2}, {-∞, Quantity[2, "Centimeters"], ∞}, {d1, d2}]Plot the probability density function:
Plot[PDF[𝒟, Quantity[x, "Centimeters"]], {x, -6, 6}, Filling -> Axis, AxesLabel -> {"cm"}]Applications (1)
Create a spliced distribution, with normal distribution in the center and tails of a heavy-tail distribution:
dist1 = NormalDistribution[];
dist2 = StudentTDistribution[3];Plot[{PDF[dist1, x], PDF[dist2, x]}, {x, -4, 4}]Find spliced distribution with continuous PDF by adjusting the weights:
sd1 = 1;
spliced = SplicedDistribution[{1, a, 1}, {-∞, -sd1, sd1, ∞}, {dist2, dist1, dist2}]Equate limits at both points of possible discontinuity:
continuityEq[p_] := Limit[PDF[spliced, x], x -> p, Direction -> 1] == Limit[PDF[spliced, x], x -> p, Direction -> -1]//Simplify{sol} = FullSimplify[Solve[continuityEq[-1] && continuityEq[1], a]]pdf = PDF[spliced /. N[sol], x]Plot PDF of the spliced distribution:
Plot[pdf, {x, -6, 6}, Exclusions -> None, Filling -> Axis]Properties & Relations (3)
A spliced distribution is related to ProbabilityDistribution and TruncatedDistribution:
{d1, d2} = {ExponentialDistribution[1], ExponentialDistribution[2]};𝒟1 = SplicedDistribution[{1 / 3, 2 / 3}, {1, 2, 3}, {d1, d2}];pdf1 = PDF[𝒟1, x]Represent as a linear combination of truncated PDFs:
{f1, f2} = {PDF[TruncatedDistribution[{1, 2}, d1], x], PDF[TruncatedDistribution[{2, 3}, d2], x]};𝒟2 = ProbabilityDistribution[(1 / 3)f1 + (2 / 3)f2, {x, 1, 3}];pdf2 = PDF[𝒟2, x]FullSimplify[pdf1 - pdf2, 1 < x < 3]A spliced distribution is related to MixtureDistribution and TruncatedDistribution:
{d1, d2} = {ExponentialDistribution[1], ExponentialDistribution[2]};𝒟1 = SplicedDistribution[{3 / 8, 5 / 8}, {1, 4, 7}, {d1, d2}];pdf1 = PDF[𝒟1, x]Represent as a mixture of truncated distributions:
𝒟2 = MixtureDistribution[{3 / 8, 5 / 8}, {TruncatedDistribution[{1, 4}, d1], TruncatedDistribution[{4, 7}, d2]}];pdf2 = PDF[𝒟2, x]FullSimplify[pdf1 - pdf2]SplicedDistribution with one distribution simplifies to TruncatedDistribution:
𝒟 = SplicedDistribution[{1}, {1, 2}, {NormalDistribution[]}];PDF[𝒟, x]PDF[TruncatedDistribution[{1, 2}, NormalDistribution[]], x]% - %%//FullSimplifyText
Wolfram Research (2012), SplicedDistribution, Wolfram Language function, https://reference.wolfram.com/language/ref/SplicedDistribution.html (updated 2016).
CMS
Wolfram Language. 2012. "SplicedDistribution." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/SplicedDistribution.html.
APA
Wolfram Language. (2012). SplicedDistribution. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SplicedDistribution.html
BibTeX
@misc{reference.wolfram_2026_spliceddistribution, author="Wolfram Research", title="{SplicedDistribution}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/SplicedDistribution.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_spliceddistribution, organization={Wolfram Research}, title={SplicedDistribution}, year={2016}, url={https://reference.wolfram.com/language/ref/SplicedDistribution.html}, note=[Accessed: 12-June-2026]}