I have the following parametric CDF:
F[x_, λ_, β_, γ_] = Piecewise[{
{0, x < 0},
{1 - (1 - β) E^(-x λ), 0 <= x < γ },
{1, x >= γ}
}];
that is for example
Plot[F[x, 0.5, 0.2, 5], {x, -10, 10}]
I'm trying to give an estimation of these parameters based on my dataset.
First I build a ProbabilityDistribution object from CDF:
myTruncExp2[λ_, β_, γ_] := ProbabilityDistribution[{"CDF",F[x, λ, β, γ]}, {x, -∞, ∞}, Assumptions -> {λ > 0, β > 0, γ > 0}];
My data list is stored in dt1 list, but these two attempts both fail:
FindDistributionParameters[dt1, myTruncExp2[λ, β, γ]]
DistributionFitTest[dt1, myTruncExp2[λ, β, γ], {"PValue", "FittedDistribution"}]
Perhaps Mathematica is unable to manage distribution object with discontinuous CDF, in fact the plot I got using the object is not what I expect
Plot[Evaluate@CDF[myTruncExp2[0.5, 0.2, 5], x], {x, -20, 20}]
Even when I represent the same function through its PDF, that is
f[x_, λ_, β_, γ_] := Piecewise[{
{0, x < 0},
{(1 - β) λ E^(-x λ), 0 <= x < γ },
{β + (1 - β) E^(-γ λ), x == γ},
{0, γ < x}
}];
putting it into the previous object
myTruncExp2[λ_, β_, γ_] := ProbabilityDistribution[f[x, λ, β, γ], {x, -∞, ∞} ,Assumptions -> {λ > 0, β > 0, γ > 0}];
the integration discards the mass point, and it still comes with the same problem
CDF[myTruncExp2[0.5, 0.2, 5], x]
$$ \begin{array}{cc} 0.734332 & x\geq 5. \\ 0.8 e^{-0.5 x} \left(e^{0.5 x}-1.\right) & 0.<x<5. \\ 0. & \text{True} \\ \end{array} $$
There would be a way to manage discontinuous custom distribution objects in Mathematica? That is, there would be a way to let Mathematica know to integrate both function and probability mass points?
May you suggest another strategy to get an estimation of these distribution parameters?
And then another strategy to perform a goodness of fit test of this distribution on my dataset?
ProbabilityDistribution
: "For a multivariate ProbabilityDistribution definition, all variables need to be either discrete or continuous; no mixed cases can occur." I would imagine that also means that one can't have a continuous part and a probability mass at a single point for univariate distributions. Also, you can normalize your distribution with theMethod->"Normalize"
option but if you really have the remaining mass at $\gamma$, then that won't be what you want. $\endgroup$