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))
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
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.