Questions tagged [binomial-cdf]

48 questions
0
votes
0 answers

How to force R to use a specified factor (categorial) level as reference in a glm?

How can I tell R to use a certain level of a categorical factor as reference if I use binary explanatory variables in a glm function? It's just using some level by default. I've tried relevel() and fct-relevel() but nothing has…
0
votes
0 answers

Use of Binomial Theorem in IP address distribution

I am currently making a project on Binomial theorem/Distribution for my semester. I need some very interesting real life applications of these to add in my project(I need to add in depth explanation of that application). I came accross these…
0
votes
0 answers

How to estimate this expectation involving two binomial random variables?

X and Y are two independent binomial random variables where X~ B(K_1, q), Y~ B(K_0, p), (Note: p+q is not necessarily equal to 1). I am wondering how to compute the following expectation (the expectation is taken over random variable X): E[X Pr(Y…
luw
  • 201
  • 2
  • 10
0
votes
1 answer

Sympy Stats: ValueError: not an integer ​

I am trying to manipulate binomial distributions algebraically. Specifically, I would like to get the expected value and standard deviation of a random variable: import sympy import sympy.stats from sympy import * a = sympy.Symbol('a',…
linhares
  • 474
  • 5
  • 16
0
votes
1 answer

What is actually going on in R -the statistics behind rbinom(3, 10, 0.75)?

What is actually going on in R (the statistics behind rbinom(3, 10, 0.75)? I know the 3 is the number of observations, the 10 is the number of trials and 0.75 is the probability of success). The first result from running the R code…
0
votes
1 answer

R generating binomial Random variables from exponential random variables

I have 100000 exponential random variables generated withrexp and I am asked to generate 100000 binomial random variables from them using built in R functions. I really don't know how can I generate one random variable from another. I searched some…
amir na
  • 217
  • 1
  • 8
0
votes
1 answer

Calculating the probability of success in k (or less) Bernoulli trials out of n using matlab

I am trying to calculate the probability of success in 70 (or less) Bernoulli trials out of 100. I wrote it with Matlab. But, I get the probability to be 1 (it can't be 1 since its not success in all 100 trials). Is my function OK? syms k f =…
0
votes
1 answer

How to calculate binomial cumulative density function with python

I have the following binomial distribution: Last year, the number of new buildings in Community Board 12 and Community Board 11 in the bronx was 347. Of those 347, 107 took place in Community Board 12. If we randomly select 70 of the 347 new…
leoro
  • 111
  • 13
0
votes
1 answer

glmer random effect nested within fixed effect

Similar questions have been posed here https://stats.stackexchange.com/questions/13000/random-effect-nested-under-fixed-effect-model-in-r and here…
0
votes
0 answers

Uniroot error when estimating coverage probability for an unspecified distribution

I am trying to compute the coverage probability for an unspecified distribution. I have copied my r codes below and the corresponding error message. Firstly, I defined the CDF as below. CD_theta <- function(x, p, n) { 1 - pbinom (x, size…
0
votes
0 answers

Coverage probability for an unspecified CDF

I used the following r code to determine the coverage probability. theta <- seq(0,1, length = 100) CD_theta <- function(y, p, n){ 1 - pbinom (y, size = n, prob = p) + 1/2*dbinom(y, size = n, prob = p) } y <- 5 n <- 100 phat <- y/n mytheta <-…
score324
  • 591
  • 4
  • 18
0
votes
1 answer

Efficient way to compute the probability distribution of a vector of pairs in python

Suppose we have a numpy array v v=np.array([3, 5]) Now we use the below code to find a new vector say w v1=np.array(range(v[0]+1)) v2=np.array(range(v[1]+1)) w=np.array(list(itertools.product(v1,v2))) So w looks like this, array([[0, 0], [0,…
PJORR
  • 57
  • 5
0
votes
2 answers

Python, calculating binomial P Value: Does this code look right?

I have this data set: ItemNumber Successes Trials Prob 15 14 95 0.047 9625 20 135 0.047 19 14 147 0.047 24 12 120 0.047 20 15 133…
TomRyan
  • 11
  • 5
0
votes
0 answers

Improve computation time of numerous binomial processes in hierachical model (openbugs/winbugs)

I am currently developing a hierarchical bayesian model in Openbugs that involves a lot (about 6000 sites) of binomial processes. It describes successive removal electric fishing events/pass and the general structure is as follow: N_tot[i]<-d[i] *…
0
votes
1 answer

How can I efficiently calculate the negative binomial cumulative distribution function?

This post is really helpful: How can I efficiently calculate the binomial cumulative distribution function? (Title = How can I efficiently calculate the binomial cumulative distribution function?) However, I need the negative binomial cumulative…
user380719
  • 9,043
  • 14
  • 50
  • 86