-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
We currently only have pdf (https://scilua.org/sci_dist.html):
y = sd:pdf(x)
Returns the value of the probability density function (for continuous distributions) or of the mass probability function (for discrete distributions) computed at x for sd. The domain of this function is the real line.
But I would like to calculate confidence intervals using the Beta distrbution:
dist = require('sci.dist')
local d = dist.beta(5,17)
print(d:ppf(0.05), d:ppf(0.95))
Example equivalent currently possible with scipy:
>>> from scipy.stats import beta
>>> print(beta.ppf([0.05, 0.95], 5, 17))
[0.09884353 0.38440811]
This seems to be based on the cephes C library. E.g.: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.btdtri.html#scipy.special.btdtri
For this I'd need the latter of:
y = sd:cdf(x): the cumulative distribution function at x (find x for cdf(y) = x)
y = sd:ppf(x): the inverse of the cumulative distribution function at x (find x for cdf(x) = y)
Reactions are currently unavailable