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

How to simulate Revenue using Bernoulli trials / Probabilities of Success in R?

I would like to simulate Revenues Scenarios upon: price and est_p (estimated probability) from the following df: df <- data.frame(price = c(200, 100, 600, 20, 100), est_p = c(0.9, 0.2, 0.8, 0.5, 0.6), …
0
votes
0 answers

How to calculate PDF of a Binomial Experiment in R

I know you can create a binomial Experiment with the Code tenCoinFlips <- rbinom(10000,10,0.5) But how can you calculate the PDF of this experiment. I know Dbinom will give you the exact PFD but is there a way to calculate the empirical PDF of an…
0
votes
1 answer

Look up BernoulliNB Probability in Dataframe

I have some training data (TRAIN) and some test data (TEST). Each row of each dataframe contains an observed class (X) and some columns of binary (Y). BernoulliNB predicts the probability of X given Y in the test data based on the training data. I…
R. Cox
  • 819
  • 8
  • 25
0
votes
0 answers

how to model a conditional Bernoulli distribution properly in python

Suppose I have a context vector x of length 5 which I sample randomly between 0 and 1. This I can code in python as import numpy as np x = np.random.uniform(0,1,5) First I want to model a reward function which is dependent on the context vector.…
user77005
  • 1,769
  • 4
  • 18
  • 26
0
votes
1 answer

TypeError: cannot perform reduce with flexible type while applying a selfmade Bernoulli fitting on a list

I'm trying to implement my own Bernoulli class with its own fit function in order to fit my train and test lists that contains words (spam detection) here's my Bernoulli class: class BernoulliNB(object): def __init__(self, alpha=1.0): …
0
votes
1 answer

Fixing a function on Bernoulli's simulation

I would like to create a function with three parameters: the sample size, the number of samples, the true p of success in a Bernoulli trial. This function would output the following results: the mean estimate of p (i.e. the average of the p…
Rororo
  • 21
  • 5
0
votes
1 answer

How do I use BernoulliNB?

I'm trying to use BernoulliNB. Using the same data to train and to test, I get predictions other than the training data and probabilities other than 1. Why is that please? import pandas as pd from sklearn.naive_bayes import BernoulliNB BNB =…
R. Cox
  • 819
  • 8
  • 25
0
votes
0 answers

Sampling distribution Normal Approximation Misfit

I was trying to simulate "Sampling Distribution of Sample Proportions" using Python. I tried with a Bernoulli Variable as in example here The crux is that, out of large number of gumballs, we have yellow balls with true proportion of 0.6. If we take…
0
votes
3 answers

Sample Distribution Simulation not resulting in Normal

I was trying to simulate "Sampling Distribution of Sample Proportions" using Python. I tried with a Bernoulli Variable as in example here The crux is that, out of large number of gumballs, we have yellow balls with true proportion of 0.6. If we take…
0
votes
1 answer

Can we combine base line Naive Bayes, Multinomial Naive Bayes and Semi-supervised NB?

I am working on sentiment analysis on twitter data. I have tried with couple of Naive Bayes models like Baseline Naive Bayes, Multinomial NB, Bernoulli NB, Semi-supervised NB. My question here is to understand if there is a way we can combine the…
0
votes
1 answer

How to use Microsoft Infer.net in Unity 2017

I am using Unity 2017.2. The Infer.Net framework requires .NET 4.0 and Unity can use only assemblies that target .NET 3.5. How do I do that?
Anton Andreev
  • 2,052
  • 1
  • 22
  • 23
0
votes
0 answers

Generate m outcomes of a geometric random variable using the cdf of the random variable

As part of an assignment, I have been asked to write an Octave function that will generate m pseudorandom outcomes of a geometric RV X with parameter p = 0.55 in 2 separate ways: Directly using the cdf of the RV Using the fact that the variable is…
KOB
  • 4,084
  • 9
  • 44
  • 88
0
votes
1 answer

Plot not extending to the complete height of my data

I am attemtping to write a function that produces m random simulations of 5 Bernoulli Trials. I create a histogram showing the distribution of the number of successes across the m simulations. I then need to also plot a line showing the theoretical…
KOB
  • 4,084
  • 9
  • 44
  • 88
0
votes
1 answer

Plotting two sets of data on one histogram

I have just began using Octave and am attempting to simulate 10,000 outcomes of a Binomial Random Variable defined as: X ~ Bi(5, 0.2) I have graphed the result with the following function: function x = generate_binomial_bernoulli(n,p,m) % generate…
KOB
  • 4,084
  • 9
  • 44
  • 88
0
votes
1 answer

Maximum Likelihood on Matlab (multivariate Bernoulli)

I am new to MATLAB's environment and no matter how much I have struggled it just seems that I cannot get the concept of how to construct a ML algorithm for a multivariate Bernoulli. I have a dataset of N variables (x1,x2,...,xN) and each variable is…
Jespar
  • 1,017
  • 5
  • 16
  • 29