# Define customised distribution with discontinuous CDF

I have the following CDF:

 F[x_] = Piecewise[{
{0, x < 0},
{0.1 x^2, 0 <= x <= 2},
{0.4, 2 < x <= 5/2},
{0.5, 5/2 < x <= 4},
{-0.5 E^-(x - 4)^2 + 1, 4 < x}
}];


Now I define the a probability distribution as follows:

 dist = ProbabilityDistribution[{"CDF", F[x]}, {x, 0, Infinity}];
G[x_] = CDF[dist, x];


But the plot of G now looks different:

It seems I lose the discontinuity point and on top of that the CDF G doesn't even go up to 1 anymore.

Question: Why do I lose the discontinuity of my CDF, and is there a way to avoid this issue?

-

It appears that Mathematica does not support discontinuous CDFs. For example, try

F[x_] := ((Sign[x] + x) + 2)/4
dist = ProbabilityDistribution[{"CDF", F[x]}, {x, -1, 1}];
Plot[{F[x], CDF[dist, x]}, {x, -1, 1}]


and you can see the results are not the same. Even if we define $F$ equivalently as

G[x_] := Piecewise[{{(1 + x)/4, -1 <= x < 0}, {(3 + x)/4, 0 <= x <= 1}}]


we still don't get the right result.

-