ihmeuw / risk_distributions

BSD 3-Clause "New" or "Revised" License
0 stars 3 forks source link

Feature/enable normal dist usage #15

Closed collijk closed 5 years ago

collijk commented 5 years ago

I'll reopen after the other PR. The purpose here is to make usage like:

from risk_distributions import EnsembleDistribution
import numpy as np

w = np.ones(len(EnsembleDistribution.distribution_types))
w /= w.sum()
mean, sd = 100, 10

q = np.linspace(0.01, 0.99, 100)
x = EnsembleDistribution(w, mean=mean, sd=sd).ppf(q)

work.

Which is to say, to allow people to have a single set of parameters and get multiple values from the distribution in a single call, which is the standard way the numpy/scipy distributions work.