Questions tagged [beta-distribution]

A two-parameter family of univariate distributions defined on the interval [0,1].

The "Beta distribution" is a two-parameter family of univariate distributions defined on the interval [0,1]. The probability density function of the distribution is:

enter image description here

with positive parameters α and β.

A common use of the distribution is in Bayesian statistics as a prior for the Binomial distribution. The Beta distribution is also used in beta regression, which can be useful when the dependent variable has a floor or ceiling effect or is bounded.

In scientific software for statistical computing and graphics, function dbeta computes density of a beta distribution, pbeta computes CDF of a beta distribution, qbeta computes quantile of beta distribution and rbeta draw samples from a beta distribution.

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, machine learning and data analysis.

85 questions
42
votes
4 answers

Promoting release from "Internal test" track to production

There is a possibility to promote Alpha/Beta releases to production with a single click of a button, but for some reason "Internal test" track doesn't have "Release to production" button and only "Release to alpha/beta". I cannot find any…
olshevski
  • 4,971
  • 2
  • 35
  • 34
10
votes
3 answers

How to properly fit a beta distribution in python?

I am trying to get a correct way of fitting a beta distribution. It's not a real world problem i am just testing the effects of a few different methods, and in doing this something is puzzling me. Here is the python code I am working on, in which I…
Jason
  • 2,950
  • 2
  • 30
  • 50
10
votes
3 answers

Random numbers from Beta distribution, C++

I've written a simulation in C++ that generates (1,000,000)^2 numbers from a specific probability distribution and then does something with them. So far I've used Exponential, Normal, Gamma, Uniform and Poisson distributions. Here is the code for…
jaff
  • 103
  • 1
  • 5
6
votes
1 answer

full precision may not have been achieved in 'qbeta'

I am running R version 2.14.0 on a PC which uses Windows 7 Ultimate (Intel Core i5-2400 3GHz processor with 8.00GB ram). Let me know if other specs needed. I am trying to simulate correlated beta distributed data. The method I am using is an…
Chris
  • 3,401
  • 5
  • 33
  • 42
5
votes
1 answer

efficient sampling from beta-binomial distribution in python

for a stochastic simulation I need to draw a lot of random numbers which are beta binomial distributed. At the moment I implemented it this way (using python): import scipy as scp from scipy.stats import rv_discrete class…
4
votes
1 answer

Updating alpha and beta parameters for Beta distribution with more and more feedback

I am working on ranking online content based on customer feedback for my college project. For that, I associate each content with a prior alpha and beta parameter and update those based on the feedback I get. As I simulate more and more trials, the…
4
votes
1 answer

four parameter beta distribution in R

Is there a built-in function to calculate a four parameter beta distribution in R? I.e., the distribution with two shape parameters and two boundary parameters so that it's not bounded [0,1]? I made my own but curious if this functionality exists…
user111024
  • 723
  • 3
  • 15
4
votes
2 answers

Python - Apply SciPy Beta Distribution to all rows of Pandas DataFrame

In SciPy one can implement a beta distribution as follows: x=640495496 alpha=1.5017096 beta=628.110247 A=0 B=148000000000 p = scipy.stats.beta.cdf(x, alpha, beta, loc=A, scale=B-A) Now, suppose I have a Pandas dataframe with the columns…
Cameron
  • 229
  • 1
  • 5
  • 17
4
votes
2 answers

What is the Python equivalent of Excel's Beta distribution?

What is the Python equivalent of the Beta distribution in Excel? In Excel, the formula is: =BETA.DIST(A2,A3,A4,FALSE,A5,A6). This gives the Beta probability density function for the given parameters, and we get the result as some decimal value.…
suraj
  • 43
  • 5
4
votes
2 answers

Need a fast Java beta distribution random number generator

I need to generate random numbers that have a beta distribution in some speed critical code. Currently I'm using the BetaRandomVariable() class from the numerics4j library - but currently represents about 95% of my code's CPU usage! Can anyone…
sanity
  • 35,347
  • 40
  • 135
  • 226
4
votes
2 answers

Any libraries that provide betainv for C++

Does anyone know of any libraries that provide the betainv function in c++? The betainv(x,a,b) computes the xth quantile of a beta distribution with parameters a,b
Aly
  • 15,865
  • 47
  • 119
  • 191
3
votes
1 answer

Specifying complex truncated beta distribution

I'd like to specify a truncated beta distribution such that the support is [0.1, 0.4], and allow for the probability density at the lower bound to be higher than very near 0. Here's what I have so far. I realize that the parameters I specify here…
matsuo_basho
  • 2,833
  • 8
  • 26
  • 47
3
votes
1 answer

How to convert x values from dbeta plot into percentage using base r?

I have the plot below using curve(dbeta(x, 81, 219)) Now, I want to convert the X values into x*100. Thanks in advance.
Krantz
  • 1,424
  • 1
  • 12
  • 31
3
votes
2 answers

How to integrate beta distribution in Python

In R, the following is used to calculate the integral between points 0 and 0.5 on beta distribution with the parameters 10 and 20: integrate(function(p) dbeta(p,10,20),0,0.5) The result is: 0.9692858 absolute error < 6.6e-08 How can this be done…
A.E
  • 997
  • 1
  • 16
  • 33
3
votes
1 answer

Why do we choose Beta distribution as a prior on hypothesis?

I saw machine learning class videos of course 10-701 year 2011 by Tom Mitchell at CMU. He was teaching on topic Maximum Likelihood Estimation when he used Beta distribution as prior on theta, I wonder he chose that only?
1
2 3 4 5 6