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

A mixture of beta distribution in R

I was given a function (a mixture of beta distribution): f(x) = beta(1,6)/3 + beta(3,6)/3 + beta(10,6)/3 My task is to plot the density of f(x). Here is my code: par(mfrow=c(1,1)) x <- seq(0,1,0.001) plot(x,dbeta(x, shape1 = 1, shape2 = 6)/3 +…
0
votes
0 answers

Computing beta distributions for multiple combinations

My data table which has 60 records* 3 fields, where: Each record represents a time stamp (t=1 till t=60) For each time stamp, we have 2 fields- the count of successes and failures based on roughly 500 turns. e.g., for t =1, there are 430…
Nibbles
  • 19
  • 6
0
votes
0 answers

Error in "as.data.frame.default(x[[i]], optional = TRUE): cannot coerce class ‘"function"’ to a data.frame" when using the gamlss function (or lme())

I am trying to fit a one-inflated Beta regression mixed model using the gamlss package using the following code: # Minimal reproducible example: efficiency <- rbeta(n = 85, shape1 = 2, shape2 = 2, ncp = 2) # My actual variable contains several…
Fanfoué
  • 165
  • 11
0
votes
1 answer

Fitting beta distribution with 0 in R

We have a dataset d3. time MV 1 0 2 0 3 0,3 ect. with more data points between 0 to 1. We wanted to fit a beta distribution, but we found out that we should try to fit an zero inflated beta distribution since our data contains…
0
votes
1 answer

R: finding the range of inputs for a function that give a certain range of outputs

I'm using pbeta(), the cumulative probability distribution fuction in R, to find the probabilities of input values (p) from 0-1. I'm interested in just a subset of those input values that give probabilities between 0.025 and 0.975 (this is a…
0
votes
0 answers

Create an array in main() instead in the function in a C program

I have the following code from the numerical recipes in C which calculates the incomplete beta function using continuous fraction and Lentz method. float betacf(float m1, float m2, float theta){ void nrerror(char error_text[]); int k, k2,…
Emotional Damage
  • 138
  • 1
  • 1
  • 9
0
votes
1 answer

Scipy distribution - Is there a method in Scipy that returns probability (not the probability density) at point?

It seems like even if distributions are continuous, I only have an access to the pdf method. However, I need the probability itself, say in [2, 2.0001]. Is there any method that I can call for a point probability? According to the document…
aerin
  • 20,607
  • 28
  • 102
  • 140
0
votes
1 answer

Is there a way to find the median using beta distribution parameters in R?

I am working with CSV dataset called productQuality where every row represents a weld type and the beta distribution parameters (α and β) for that specific weld. I was wondering if there's a way to calculate and list the medians for each weld type?…
Jack
  • 57
  • 4
0
votes
1 answer

Equivalent function to Excel's BETADIST() in R

I am looking for the equivalent function to BETADIST(). I tried dbeta and dbetadist but these do not give the same result as Excel's BETADIST. BETADIST(1/13,2,4) = 0.050583 dbeta(1/13,2,4, log=F) = 1.210042 What did I miss? Thank you for your…
hnguyen
  • 772
  • 6
  • 17
0
votes
1 answer

How to batch a transformed (scaled and quantized) Beta distribution in tensorflow probability

I'm trying to fit a beta distribution to the results of a survey with discrete scores (1, 2, 3, 4, 5). For that to work I need a working log_prob of a Beta in TensorFlow probability. However, there is a problem with how batching is handled in…
rv_normal
  • 80
  • 9
0
votes
1 answer

How to perform a post hoc test for a mixed model in beta distribution (I am using R's gamlss library)?

How do I perform a post hoc test for a random effect beta distribution? To build the mixed model with beta distribution I used the library gamlss (I found no other way to do this in R). In this model there is a factor with three levels. Suppose…
Omar
  • 19
  • 3
0
votes
1 answer

Compute the Bayes factor of an A/B test dataset in r

I am trying to compute the Bayes factor of an A/B test dataset that can be found here. However, I end up with a NaN because the beta coefficient evaluates to zero. In calculating the likelihoods, I am assuming that it follows the binomial…
Salma Bouzid
  • 65
  • 1
  • 9
0
votes
1 answer

Statistics in Python

I'm taking a Machine Learning class and we are given our first statistics- "programming" exercise. So the exercise goes like this: Recall the story from the lecture “Two sellers at Amazon have the same price. One has 90 positive and 10 negative…
Liat Khitman
  • 23
  • 1
  • 6
0
votes
1 answer

How do I estimate parameters of beta distribution with known percentiles in r

I have this dataset which I know is from a beta distribution but with unknown parameters: 2.5% 0.264 50% 0.511 97.5% 0.759 Is there anyway to find the best-fit beta distribution and estimate the shape parameters by using r?
0
votes
1 answer

Python drop random numbers of a beta distribution

I have a question about beta distributions and random variables. My data includes performance data from 2012 to 2016 on an hourly basis. I recalculated the data monthly, so I have only one value for every month. After that, I created a new df with…
Pyrmon55
  • 183
  • 1
  • 3
  • 14