Questions tagged [binomial-cdf]

58 questions
2
votes
3 answers

Find the two points on the x-axis corresponding to the intersections for a cdf

The corresponding r code is given below. theta <- seq(0,1, length = 10) CD_theta <- function(x, p, n){ 1 - pbinom(x, size = n, prob = p) + 1 / 2 * dbinom(x, size = n, prob = p) } Then I graphed the data as follows : mytheta <- CD_theta(5, theta,…
score324
  • 687
  • 10
  • 18
2
votes
2 answers

Enumerate all possible combined probabilities of a series of Bernoulli trials with different probabilities

Suppose I have a series of n probabilities for success of independent Bernoulli trials, p1 to pn such that p1 != p2 != ... != pn. Give each trial a unique name. p <- c(0.5, 0.12, 0.7, 0.8, .02) a <- c("A","B","C","D","E") I know from…
paqmo
  • 3,649
  • 1
  • 11
  • 21
2
votes
2 answers

R, use binomial distribution with more than two possibilities

I know this is probably elementary, but I seem to have a mental block. Let's say you want to calculate the probability of tossing a 4, 5, or 6 on a roll of one die. In R, it's easy enough: sum(1/6, 1/6, 1/6) This gives 1/2 which is the correct…
ccc31807
  • 761
  • 8
  • 17
2
votes
1 answer

R: How to change the default FDR value imbedded in the nbinomTest() function?

I have a table, here's the start: WE1_counts WE2_counts M1_counts M2_counts M3_counts YAL008W 465 291 911 926 946 YBR255W 1040 1357 1428 1304 1112 YGR131W 95 170 230 113 138 YNL003ßC 1800 3107 3979 3012 2899 YBR135W…
zfz
  • 153
  • 3
  • 16
1
vote
2 answers

Need help optimizing a triple nested Binomial CDF in python

I have to calculate a triple summation (Nested Binomial CDF), the equation is below, It is a Binomial summation first from k = 0 to C then m = 0 to k and f = 0 to C-k, here s is a function which takes an input between 0 and 1 and gives an output…
AbbyDabby
  • 33
  • 4
1
vote
0 answers

Comparison between the estimated versus observed Poisson and Binomial distributions does not produce adequate results

# Packages library(MASS)# Pacote MASS library(car) # Pacote car # Create some artificial numbers with binomial negative distribution S<-10 P<-0.6 N<-rnbinom(n=283, size=S, prob=P) # Poisson…
Leprechault
  • 1,531
  • 12
  • 28
1
vote
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…
1
vote
1 answer

Draw random numbers from Boost binomial distribution

Here is an example to draw random numbers from a binomial distribution with std::binomial_distribution #include int main () { std::mt19937 eng(14); std::binomial_distribution dist(28,0.2); size_t randomNumber = dist(eng); …
Remi.b
  • 17,389
  • 28
  • 87
  • 168
1
vote
1 answer

calculating the next state of an observation

I´m trying to calculate the next state from a given probability vector extracted from a transition matrix. probs <- structure(c(0.876896837675484, 0.101918293545303, 0.0189210190005101, 0.00220982524291829, 5.40245357842536e-05), .Names = c("State…
1
vote
1 answer

Difference between excel and scipy cumulative binomial distribution p values?

I have this table (NumSucc = Number of successes, NumberTrials = Number of trials and Prob is the probability of success) : Gene NumSucc NumTrials Prob Gene1 16 26 0.9548 Gene2 16 26 0.9548 Gene3 12 21 …
TomRyan
  • 11
  • 5
1
vote
0 answers

R glm(): confusing confidence intervals for binomial regression

I have been using glm() in R to compute confidence intervals for the logit probability parameter governing a single binomial draw. P <- 20 # Number of successes D <- 1 # Number of failures model1 <- glm(matrix(c(P,D), nrow=1) ~ 1,…
Jacob Socolar
  • 1,172
  • 1
  • 9
  • 23
1
vote
2 answers

Attempt to get numbers instead of NaN values when printing

I've a simple program with a for loop where i calculate some value that I print to the screen, but only the first value is printed, the rest is just NaN values. Is there any way to fix this? I suppose the numbers might have a lot of decimals thus…
John
  • 317
  • 4
  • 19
1
vote
0 answers

Computing the expected value of a function of a binomially distributed r.v

I'm trying to compute the expected value of a function of X, where X is binomially distributed. So I want to compute something on the form of sum(Pr(X=k)*f(k),k=0,..,n). Now I want to see if the value converges as the binomial tree increases, i.e.…
1
vote
1 answer

Code returns minimal m s.t P(X>m)=1/n^2 for binomial experiment

Assume we do an experiment where we throw n balls into n jars. X is an independent variable describes number of balls int the first jar. Build a function returns the smallest integer fulfills P(X>m)<1/n^2. The distribution is binomial so I wrote…
Danis Fischer
  • 375
  • 1
  • 7
  • 27
1
vote
2 answers

How to generate a series of pulses whose ON time follows the binomial distribution?

I have a simple question: I am trying to simulate a train of digital pulses (max=1, min=0). The distribution of ON-times should follow a Binomial distribution. How do I do this? I am using VisualStudio 2012. This is a very trivial question and I…
Antillar Maximus
  • 227
  • 1
  • 2
  • 12