Returns the probability mass for each value in x. Mass
pmf[i] is located at boundaries[i+1] (the right edge of
bin i); all other values return 0.
Arguments
- x
Numeric vector of values at which to evaluate the PMF.
- boundaries
Numeric vector of length \(K+1\) defining the bin edges. Must be strictly increasing. Defaults to
0:K(unit-width daily bins) whereKis inferred fromlength(pmf).- pmf
Numeric vector of length \(K\) giving the probability mass for each bin. Must be non-negative and sum to approximately 1; if either condition is violated the function returns a vector of
.Machine$double.epsrather than 0 (a soft simplex penalty that keeps log-density finite inside fitting closures).
Details
Like pdiscretestep, this function applies a soft simplex
penalty: if pmf contains negative entries or fails to sum to 1
(within \(10^{-8}\)), the function returns near-zero density
(.Machine$double.eps) rather than erroring. This makes it safe to
call from inside fitdistrplus::fitdist() closures driven by
fitdistdoublecens.
See also
Other pdiscretestep:
hazards_to_pmf(),
pdiscretestep(),
pmf_to_hazards(),
rdiscretestep()
