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
1
vote
1 answer

Using graphs, how can I show that the logistic function is just an inverse logit function in R?

To plot my logistic function, I used: plot(plogis, from = -10, to = 10) My x values were: -10 to 10 So, based off of that graph's output, what should I do next? Edit: If I plot the logistic function, y = logistic(x) = 1/(1+exp(−x)), how do I go…
Danny
  • 13
  • 3
1
vote
4 answers

How to generate the bernoulli tensor in tensorflow

How can I generate a tensor in tensorflow of Bernoulli distribution with factor p ? For example: a = tf.bernoulli(shape=[10,10], p) generates a matrix 10x10 of 0-1 where each element of matrix is one with probability p and zero with probability…
M.Bejani
  • 11
  • 5
1
vote
1 answer

Is there a function in R to create a discrete probability distribution?

I have a set of Bernoulli variables, giving specific values with different probabilities. The variables are independent. I'm trying to build a simple discrete probability table for all the possible outcomes. A short example of the data I have is: #…
Amidavid
  • 177
  • 7
1
vote
2 answers

How to calculate the joint log-likelihood for Bernoulli Naive Bayes

For a classification problem using BernoulliNB , how to calculate the joint log-likelihood. The joint likelihood it to be calculated by below formula, where y(d) is the array of actual output (not predicted values) and x(d) is the data set of…
Aman
  • 979
  • 3
  • 10
  • 23
1
vote
1 answer

How can I initialize variables with Bernoulli distribution in TensorFlow?

How can I initialize variables in TensorFlow? I want to associate each weight with a Bernoulli distribution: with probability of p to get some value x1, and with probability of 1-p to get some value x2. How should I initialize this matrix? I…
1
vote
0 answers

Why is bayesian glm values negative?

I have a very basic pymc3 GLM Bernoulli model and was wondering why the values are negative? I must be doing something wrong, but I wish to be able to make predictions with the model. How would I go about making predictions if the values are…
Tjorriemorrie
  • 16,818
  • 20
  • 89
  • 131
1
vote
0 answers

Naive Bayes P(Y|X) distribution modelling

My task is to write function which return P(y|x) distribution for each of class (with use of Naive Bayes classifier). The result is N x M matrix. Input data `p_y` -> a prior probabilities for labels 1 x M `p_x_1_y` -> probability distribution P(x…
1
vote
1 answer

Naïve Bayes Classifier Bernoulli model

I'm working on classifying invoices and receipt and I will be working with Bernoulli model. This is the naive Bayes classifier : P(c|x) = P(x|c) x P(c) / P(x) I know how to compute P(c) class prior probability and since we assume that all the words…
1
vote
2 answers

Is restarting random generator equivalent to restarting bernoulli process?

I want to simulate Bernoulli process. I drop a coin N times by initRand(); p = 0.5; for ( int i=0; i
rlib
  • 7,444
  • 3
  • 32
  • 40
1
vote
1 answer

PyMC Bernoulli model checking

I am currently trying to do model checking with PyMC where my model is a Bernoulli model and I have a Beta prior. I want to do both a (i) gof plot as well as (ii) calculate the posterior predictive p-value. I have got my code running with a Binomial…
fsociety
  • 1,791
  • 4
  • 22
  • 32
1
vote
1 answer

Does `org.apache.commons.math3.distribution.BinomialDistribution(1,p)` come with much performance overhead?

A Bernoulli distribution is equivalent to a binomial distribution with only 1 trial i.e. BinomialDistribution(1,p) from the Apache Commons Math library. A Bernoulli distribution is obviously a much simpler thing than the general binomial…
Museful
  • 6,711
  • 5
  • 42
  • 68
1
vote
1 answer

Is this R code of Rao score test for the Bernoulli data model correct?

I am a complete statistical noob and new to R, hence the question. I've tried to find an implementation of the Rao score for the particular case when one's data is binary and each observation has bernoulli distribution. I stumbled upon anova in the…
alisianoi
  • 2,003
  • 3
  • 31
  • 46
1
vote
1 answer

Need help structuring a Monte Carlo simulation and finding percentiles of the result with R

I have a CSV file containing a set of events (ca 40 items), all of which can either happen or not, depending on given probability. Columns: event name, yield size, probability. What interests me of this data is the total yield size of the set (sum…
user315648
  • 1,945
  • 3
  • 22
  • 30
1
vote
1 answer

Scikit-learn: BernoulliNB, v0.10 vs v0.13: very different results

This is something of a follow-up to this thread, where I was getting erroneous results with the GaussianNB classifier, which turned out to be because I had scikit-learn v0.10 on the linux VM I was doing experiments on. I ended up using the…
0
votes
0 answers

Pytorch: Bernoulli "without replacement"

Given a probability tensor, how can I use torch.bernoulli to generate multiple samplings while ensuring they are all distinct? Is there any better way than the naive way, i.e., just sampling and re-trying if colliding? Any method using other…
Vezen BU
  • 113
  • 6