0

How can i add n choose k and add it to the binomial CDF so i can plot it for my data x?

#Parameters: 
n = 2*n+1
p= sum(x)/(2*n+1)

#Binomial CDF

sum((p^i)*(1-p)**(n-i))
Btzzzz
  • 143
  • 9

2 Answers2

1

You should try to check this link : Binomial distribution CDF using scipy.stats.binom.cdf to plot binomial CDF using matplotlib histogram and scipy stat binom

Simon J
  • 86
  • 4
0

You can get nCk from :

from math import factorial
def n_choose_k(n, k):
    return factorial(n) // factorial(k) // factorial(n-k)

Its not super clear however what your goal is, in particular the n=2*n+1 bit.

jeremy_rutman
  • 3,552
  • 4
  • 28
  • 47