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# | Copy Code |
BetaDistribution beta1 = new BetaDistribution(1.5, 0.8); |
| Visual Basic | Copy 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# | Copy Code |
BetaDistribution beta2 = new BetaDistribution(1.5, 0.8, 1, 4); |
| Visual Basic | Copy 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# | Copy Code |
MersenneTwister random = new MersenneTwister();
double variate = BetaDistribution.GetRandomVariate(random, 1.5, 0.8); |
| Visual Basic | Copy 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
Copyright 2004-2008,
Extreme Optimization. All rights reserved.
Extreme Optimization, Complexity made simple, M#, and M
Sharp are trademarks of ExoAnalytics Inc.
Microsoft, Visual C#, Visual Basic, Visual Studio, Visual
Studio.NET, and the Visual Studio Logo are registered trademarks of Microsoft Corporation