Questions tagged [bernoulli-probability]

Anything related to Bernoulli in the field of probability, such as Bernoulli random variables, Bernoulli probability distribution, Bernoulli random processes, etc.

Anything related to Bernoulli in the field of probability, such as Bernoulli random variables, Bernoulli probability distribution, Bernoulli random processes, etc.

The Bernoulli distribution is a discrete distribution parametrized by a "success" probability $p$. For a Bernoulli distributed random variable $x$, the probability mass function (pmf) takes a value of $p$ at $x=1$, and $(1-p)$ for $x=0$. A concise representation of the pmf is:

enter image description here

The Bernoulli distribution is a special case of the binomial distribution with a single trial ($n=1$).

See, for example, Wikipedia on:

Tag usage

Questions on should be about implementation and programming problems, not about the statistical or theoretical properties of the technique. Consider whether your question might be better suited to Cross Validated, the StackExchange site for statistics and machine learning.

73 questions
0
votes
2 answers

R error: Incorrect number of dimensions

I have some categorical data showing plant family, fruit type, fruit colour, and seed dispersal, where the response variable (Dispersal) is either 0 for no or 1 for yes. test1.3 FAMILY FRUIT_TYPE COLOUR_RF Dispersal 3 Erythroxylaceae…
Ryan Rothman
  • 163
  • 1
  • 4
  • 12
0
votes
1 answer

How to define a bernoulli density function?

The following is the funciton defined for bernoulli distribution. I am a new R user. I am not quite well-understand the following codes. dbernoulli <- function(x, prob=0.5) { dbinom(x, size=1, prob=prob) } dbernoulli(y, prob=0.7) I thought in…
statistics_learning
  • 427
  • 1
  • 4
  • 14
0
votes
1 answer

Draw numbers from Bernoulli distribution using scipy

How can I draw numbers from a Bernoulli distribution using scipy efficiently?
Fabian Rost
  • 2,284
  • 2
  • 15
  • 27
0
votes
1 answer

Can you use counts in sklearn logistic regression input?

So, I know that in R you can provide data for a logistic regression in this form: model <- glm( cbind(count_1, count_0) ~ [features] ..., family = 'binomial' ) Is there a way to do something like cbind(count_1, count_0) with…
user
  • 621
  • 1
  • 9
  • 21
0
votes
0 answers

Q-Q Plot for Simulation Study with Bernoulli Data Issue

I'm currently trying to carry out a simulation study for Bernoulli Data to show that the sample proportion, ˆp, is also approximately normally distributed when the sample size is large. From an exercise I'm told that the Bernoulli Data is generated…
JamesR
  • 113
  • 1
  • 1
  • 8
0
votes
1 answer

Bernoulli distribution in Python/Scipy

I'm trying to use the Bernoulli distribution to generate a matrix in which each line cell has a probability of line_id/total_lines to be 1.0. That's my code: from scipy.stats import bernoulli import numpy img_size = 100 img_number = 100 res =…
pceccon
  • 9,379
  • 26
  • 82
  • 158
0
votes
1 answer

Dependent Bernoulli trials confidence interval

I would like to know if there is a way to build a confidence interval, for a random variable which has a Bernoulli distribution, based on its history. I mean if the order of its states is 11100 (i.e. lets consider its 5 last states), the confidence…
0
votes
0 answers

unbiased coin tossing with a biased coin in matlab

I have a question about a MATLAB problem dealing with a bias coin. Suppose I want to simulate a bias coin with the probability of turning up heads that behaves in accordance with the following dataset p ={0.5,0.4,0.3,0.2, 0.1}. How would I…
dirty_sanchez
  • 69
  • 1
  • 1
  • 12
0
votes
1 answer

How to get distribution of sum of dependent bernoulli variables

I have N bernoulli variables, X1, ..., XN, and Xi~B(1, pi), pi is known for each Xi, and Y=X1+...XN, now I need to get the destribution of Y. If Xi and Xj is independent when i!=j, then I can use the simulation: 1. Generate `X1`, ..., `XN` via their…
PepsiCo
  • 1,399
  • 4
  • 13
  • 18
-1
votes
1 answer

Using scipy.stats.bernoulli to simulate 1/3 probability

Our task is to recreate the famous fair coin flip (p=0.5) using only bernoulli.rvs() to generate function with uniform discrete distribution (outcomes = 0,1,2). Is it possible to do using only bernoulli function form scipy.stats?
-1
votes
1 answer

Random weighted distribution

For example I have an array like: $items = [ '0' => [ 'name' => 'item1', 'percent' => 10 ], '2' => [ 'name' => 'item2', 'percent' => 20 ], '3' => [ 'name' => 'item3', …
niQitos
  • 89
  • 1
  • 8
-1
votes
1 answer

What is the optimal way to draw repeatedly from (0,1) with a vector of varying probabilities? (R)

I often face the problem that I want to draw samples repeatedly with replacement from c(0,1) with varying vector of 'success' probabilities prob, such as prob <- c(1:5/10) Two options using both a for loop are: A <- numeric() n <-…
tomka
  • 2,516
  • 7
  • 31
  • 45
-2
votes
1 answer

Design an experiment to find the unfair coin from 100 coins

Suppose there are 100 coins, out of which only 1 coin is unfair. This unfair coin has the probability of less than 0.5 to get a Head. How do I design an experiment to find the unfair coin? I think one way is for flip each coin for a large number of…
saber
  • 7
  • 2
1 2 3 4
5