2

How can I calculate the cumulative distribution function using a different model ? I'm specifically referring to this function

from scipy.stats import norm
norm.cdf(1639651)

Replacing he above fucntion with another one that can genearte the N50, α = , and β for any dataset.

NNN
  • 41
  • 3

1 Answers1

0

You can define your model as a class that extends stats.rv_continuous as so:

from scipy import stats
class deterministic_gen(stats.rv_continuous):
    def _cdf(self, x):
        return np.where(x < 0, 0., 1.)
    def _stats(self):
        return 0., 0., 0., 0.

I think you can define only th estats and the cdf will follow. Here is the documentation: link

gnahum
  • 426
  • 1
  • 5
  • 13