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

Netlogo - Sampling from a Beta-Pert Distribtuion

I'm posting this partially to get a question answered and partially so someone else might find it later and save them the headache. I am trying to create a beta-pert distribution in NetLogo by following the formula here from Epix Analytics I've…
1
vote
0 answers

R qbeta with vectors slow speed

I have 3 vectors called vp, va and vb: vp contains 1.5 million random probabilities va contains 1.5 million alpha values vb contains 1.5 million beta values I am trying to create an output that is a vector that looks like: vanswer <-…
1
vote
2 answers

How to decide the on the shape of the Beta Distribution?

Suppose we toss a coin which is not fair. and the probability of success is 0.7. Is that enough to decide on the shape of it beta distribution ? what would be its shape then ? As far as I know, it's the probability of success that we map in the…
Prasadika
  • 897
  • 2
  • 20
  • 36
0
votes
0 answers

beta regression with optim in R

I am trying to estimate parameters in a beta regression using optim in R. I can do so if I parameterize the model with mu and phi as is done in the package betareg. That optim code is shown below. However, I cannot estimate alpha and beta…
Mark Miller
  • 12,483
  • 23
  • 78
  • 132
0
votes
1 answer

estimate alpha and beta from beta distribution from a set of probabilities in R

I would like to estimate the alpha and beta parameters from a beta distribution when all I have is a set of probabilities. I cannot seem to find an example of this online. Below I try three approaches: the betareg package, Ben Bolker's bbmle…
Mark Miller
  • 12,483
  • 23
  • 78
  • 132
0
votes
1 answer

How to overlay Beta distribution with other distribution simultaneously using ggplot2 in R?

It might be a simple question but I have been trying to fix this issue for a few days so any help is really appreciated. If there is something wrong about my question, please leave a comment so I know what I am doing wrong. I have the following…
0
votes
1 answer

how to overlay Beta distribution on histogram ggplot2?

Lets say I have the following data library(ggplot2) set.seed(2203) data <- runif(100, 15, 45) df <- data.frame(data) And my end goal is to overlay 3 different distributions on the histogram depicting this data. I have no issue overlaying "Normal"…
0
votes
0 answers

Transferring probability histogram into a Beta distribution and adding this to an empty matrix

I have the following info for when a person can get infected: age <- c(15, 16, 17, 18, 19, 20, 21) probabilityofinfection <- c(0.0010169, 0.054234662, 0.236308169, 0.419834391, 0.239213597, 0.047455329, 0.001936952) sum(getinfected) #adds up to…
0
votes
2 answers

How would I learn parameters of a beta distribution in TensorFlow Probability?

I'm trying to use TensorFlow Probability to learn the alpha and beta parameters of a beta distribution. I can't get it to work for some reason - the loss is all NaN values. Here's what I have: from scipy.stats import beta import pandas as pd import…
0
votes
0 answers

Sampling from custom beta distribution with negative bounds

I want to sample from a custom beta distribution where the lower bound is a negative value. How would I fix the below? import matplotlib.pyplot as plt import numpy as np from scipy import special, stats class bounded_beta(stats.rv_continuous): …
matsuo_basho
  • 2,833
  • 8
  • 26
  • 47
0
votes
0 answers

Why do my beta priors produce unexpected results from rethinking::ulam()?

I've been trying to run a binomial MCMC model through rethinking::ulam() using beta priors (0.5,5), but the resulting posterior prediction density plots start from 0.5 on the x axis, rather than 0. For some background context, my data is in the…
Lelia BS
  • 1
  • 3
0
votes
1 answer

Model comparison for glmmTMB objects with beta family

We are performing a beta mixed-effects regression analysis using glmmTMB package, as shown below: mod = glmmTMB::glmmTMB(data = data, formula = rating ~ par1 + par2 + par3 + (1|subject)+(1|item), …
listopad
  • 1
  • 1
0
votes
1 answer

Beta distribution curves with Python and scipy to distribute man-days effort

The goal is to distribute man-days effort (y axis) through the days time period (x axis) according to defined curve shapes: Bell, FrontLoad, BackLoad, U-shape These models could be perfectly drawn with Beta distribution and playing with the 'a' and…
Klever
  • 133
  • 8
0
votes
1 answer

Dynamic plot with matplotlib slider

I want to make a dynamic plot with the help of matplotlib Slider. My function gets an array of a, b values for plotting beta distribution functions, and each value from slider should update the plot with the new a, b values. Here is my code. def…
foxel
  • 165
  • 10
0
votes
1 answer

Problem with theoretical density functions plotted to histograms in R

I did simulations in R and plotted the results in histograms. There is no problem adding probability density into the histograms with the density() function. But for some reason I get very strange results when I plot the theoretical densities to…