Extreme Optimization > User's Guide > Statistics Library > Continuous Probability Distributions > The Beta Distribution

Extreme Optimization User's Guide

User's Guide

Up: Continuous Probability Distributions Next: The Cauchy Distribution Previous: Continuous Distributions Contents

The Beta Distribution

The Beta distribution is often used to model random variables with a finite range. The Beta distribution is also used in Bayesian analysis.

The Beta distribution has two shape parameters, usually denoted by the Greek letters α and β. Its probability density function (PDF) is:

Unlike most other distributions, location and scale parameters are not usually used to specify the general form of the Beta distribution. Instead, the lower and upper bounds of the definition interval are used.

For certain specific values of the parameters α and β, the beta distribution is equivalent to a simpler distribution. For α = β = 1, the beta distribution is equivalent to the uniform distribution. For α = 1 and β = 2, and α = 2 and β = 1, the beta distribution reduces to a triangular distribution. For α and β very large, the beta distribution approximates to the normal distribution.

The beta distribution is implemented by the BetaDistribution class. It has three constructors. The first constructor takes the two shape parameters, α and β as arguments. The following constructs a beta distribution with α = 1.5 and β = 0.8:

C# CopyCode imageCopy Code
BetaDistribution beta1 = new BetaDistribution(1.5, 0.8);
Visual Basic CopyCode imageCopy Code
Dim beta1 As ChiSquareDistribution = New BetaDistribution(1.5, 0.8)

The second constructor takes two extra parameters that specify the lower and upper bound of the interval on which the beta distribution is defined. The default is a lower bound of 0 and an upper bound of 1. The following constructs a beta distribution with α = 1.5 and β = 0.8 over the interval [1, 4]:

C# CopyCode imageCopy Code
BetaDistribution beta2 = new BetaDistribution(1.5, 0.8, 1, 4);
Visual Basic CopyCode imageCopy Code
Dim beta2 As ChiSquareDistribution = New BetaDistribution(1.5, 0.8, 1, 4)

If a variable is assumed to have a beta distribution, then the parameters of the distribution can be estimated using the method of matching moments. The third constructor performs this calculation. It takes one parameter: a NumericalVariable whose distribution is to be estimated. This constructor estimates a standard beta distribution, with lower bound and upper bound equal to 0 and 1, respectively.

Note that parameter estimation says nothing about how well the estimated distribution fits the variable's distribution. Use one of the goodness-of-fit tests to verify the appropriateness of the choice of distribution.

The BetaDistribution class has four specific properties that correspond to the parameters of the distribution. The Alpha and Beta properties return the shape parameters, α and β. The LowerBound and UpperBound properties return the bounds of the interval on which the beta distribution is defined.

BetaDistribution has one static (Shared in Visual Basic) method, GetRandomVariate, which generates a random variate using a user-supplied uniform random number generator.

C# CopyCode imageCopy Code
MersenneTwister random = new MersenneTwister();
double variate = BetaDistribution.GetRandomVariate(random, 1.5, 0.8);
Visual Basic CopyCode imageCopy Code
Dim random As MersenneTwister = New MersenneTwister()
Dim variate As Double = BetaDistribution.GetRandomVariate(random, 1.5, 0.8)

For details of the properties and methods common to all continuous distribution classes, see the topic on ContinuousDistribution class.

Up: Continuous Probability Distributions Next: The Cauchy Distribution Previous: Continuous Distributions Contents

Overview
Introduction
Features
Documentation
QuickStart Samples
Sample Applications
Downloads
Get it now!
Download trial version
How to Buy
Information
Resources
Contact Us
Search

"The Extreme Optimization Statistics Library for .NET is a major boon for those doing statistical work in .NET. I strongly recommend this product."
- Marc Brooks

"I have made it my mission to institutionalize the value of good API design.  I strongly believe that this is key to making developers more productive and happy on our platform. It is clear that you value good API design in your work, and take to heart developer productivity and synergy with the .NET framework."
- Brad Abrams,
Lead Program Manager, Microsoft.

This is a partial list of companies who are using our libraries:
ABB Robotics
Allstate
Applied Materials
Arcam
Astra Schedule
Babson College
Canadian Council on Learning
Canyon Associates
Caxton Associates
CECity
Constellation Energy
CreditSights
DeepOcean
Duke University
Dynamotive
Elecsoft
Engelhard Corporation
Epcor
Equipoise Software
Galileo International
GAM UK
Gammex
GlaxoSmithKline
Global Matrix
The Hartford
Infinera Corporation
Intel
JDS Uniphase
LaBranche & Co.
Learning & Skills Council
Jacobs Consultancy
Litman Gregory
Lucas Systems
Malvern Instruments
Medrio
Merck & Co.
Mintera.
Monitor Software
MorningStar
NanoString Technologies
Paletta Invent
Parametric Portfolio Associates
Prosanos
RATA Associates
RiskShield
Ramboll
Standard & Poor's
Strategic Analysis Corporation
Univ. of Alicante
Univ. of South Carolina
vielife
Xerox
US Army