🕷️ Crawler Inspector

URL Lookup

Direct Parameter Lookup

Raw Queries and Responses

1. Shard Calculation

Query:
Response:
Calculated Shard: 126 (from laksa103)

2. Crawled Status Check

Query:
Response:

3. Robots.txt Check

Query:
Response:

4. Spam/Ban Check

Query:
Response:

5. Seen Status Check

ℹ️ Skipped - page is already crawled

📄
INDEXABLE
CRAWLED
5 hours ago
🤖
ROBOTS ALLOWED

Page Info Filters

FilterStatusConditionDetails
HTTP statusPASSdownload_http_code = 200HTTP 200
Age cutoffPASSdownload_stamp > now() - 6 MONTH0 months ago
History dropPASSisNull(history_drop_reason)No drop reason
Spam/banPASSfh_dont_index != 1 AND ml_spam_score = 0ml_spam_score=0
CanonicalPASSmeta_canonical IS NULL OR = '' OR = src_unparsedNot set

Page Details

PropertyValue
URLhttps://www.statlect.com/probability-distributions/beta-distribution
Last Crawled2026-04-17 12:58:55 (5 hours ago)
First Indexed2016-05-05 07:46:26 (9 years ago)
HTTP Status Code200
Meta TitleBeta distribution | Properties, proofs, exercises
Meta DescriptionThe beta distribution explained, with examples, solved exercises and detailed proofs of important results.
Meta Canonicalnull
Boilerpipe Text
The Beta distribution is a continuous probability distribution often used to model the uncertainty about the probability of success of an experiment. Table of contents How the distribution is used Uncertainty about the probability of success Data collection Updating of priors Definition Expected value Variance Higher moments Moment generating function Characteristic function Distribution function More details Relation to the uniform distribution Relation to the binomial distribution Solved exercises Exercise 1 Exercise 2 Exercise 3 How the distribution is used The Beta distribution can be used to analyze probabilistic experiments that have only two possible outcomes: success, with probability ; failure, with probability . These experiments are called Bernoulli experiments. Uncertainty about the probability of success Suppose that is unknown and all its possible values are deemed equally likely. This uncertainty can be described by assigning to a uniform distribution on the interval . This is appropriate because: , being a probability , can take only values between and ; the uniform distribution assigns equal probability density to all points in the interval, which reflects the fact that no possible value of is, a priori, deemed more likely than all the others. Data collection Now, suppose that: we perform independent repetitions of the experiment; we observe successes and failures. Updating of priors After performing the experiments, we want to know how we should revise the distribution initially assigned to , in order to properly take into account the information provided by the observed outcomes. In other words, we want to calculate the conditional distribution of (also called posterior distribution), conditional on the number of successes and failures we have observed. The result of this calculation is a Beta distribution. In particular, the conditional distribution of , conditional on having observed successes out of trials, is a Beta distribution with parameters and . Definition The Beta distribution is characterized as follows. A random variable having a Beta distribution is also called a Beta random variable. The following is a proof that is a legitimate probability density function . Proof Expected value The expected value of a Beta random variable is Proof It can be derived as follows: Variance The variance of a Beta random variable is Proof Higher moments The -th moment of a Beta random variable is Proof By the definition of moment, we have where in step we have used recursively the fact that . Moment generating function The moment generating function of a Beta random variable is defined for any and it is Proof The above formula for the moment generating function might seem impractical to compute because it involves an infinite sum as well as products whose number of terms increase indefinitely. However, the function is a function, called Confluent hypergeometric function of the first kind , that has been extensively studied in many branches of mathematics. Its properties are well-known and efficient algorithms for its computation are available in most software packages for scientific computation. Characteristic function The characteristic function of a Beta random variable is Proof The derivation of the characteristic function is almost identical to the derivation of the moment generating function (just replace with in that proof). Comments made about the moment generating function, including those about the computation of the Confluent hypergeometric function, apply also to the characteristic function, which is identical to the mgf except for the fact that is replaced with . Distribution function The distribution function of a Beta random variable is where the function is called incomplete Beta function and is usually computed by means of specialized computer algorithms. Proof More details In the following subsections you can find more details about the Beta distribution. Relation to the uniform distribution The following proposition states the relation between the Beta and the uniform distributions. Proposition A Beta distribution with parameters and is a uniform distribution on the interval . Proof Relation to the binomial distribution The following proposition states the relation between the Beta and the binomial distributions. Proposition Suppose is a random variable having a Beta distribution with parameters and . Let be another random variable such that its distribution conditional on is a binomial distribution with parameters and . Then, the conditional distribution of given is a Beta distribution with parameters and . Proof We are dealing with one continuous random variable and one discrete random variable (together, they form what is called a random vector with mixed coordinates). With a slight abuse of notation, we will proceed as if also were continuous, treating its probability mass function as if it were a probability density function. Rest assured that this can be made fully rigorous (by defining a probability density function with respect to a counting measure on the support of ). By assumption has a binomial distribution conditional on , so that its conditional probability mass function is where is a binomial coefficient . Also, by assumption has a Beta distribution, so that is probability density function is Therefore, the joint probability density function of and is Thus, we have factored the joint probability density function as where is the probability density function of a Beta distribution with parameters and , and the function does not depend on . By a result proved in the lecture entitled Factorization of joint probability density functions , this implies that the probability density function of given is Thus, as we wanted to demonstrate, the conditional distribution of given is a Beta distribution with parameters and . By combining this proposition and the previous one, we obtain the following corollary. Proposition Suppose that is a random variable having a uniform distribution. Let be another random variable such that its distribution conditional on is a binomial distribution with parameters and . Then, the conditional distribution of given is a Beta distribution with parameters and . This proposition constitutes a formal statement of what we said in the introduction of this lecture in order to motivate the Beta distribution. Remember that the number of successes obtained in independent repetitions of a random experiment having probability of success is a binomial random variable with parameters and . According to the proposition above, when the probability of success is a priori unknown and all possible values of are deemed equally likely (they have a uniform distribution), observing the outcome of the experiments leads us to revise the distribution assigned to , and the result of this revision is a Beta distribution. Solved exercises Below you can find some exercises with explained solutions. Exercise 1 A production plant produces items that have a probability of being defective. The plant manager does not know , but from past experience she expects this probability to be equal to . Furthermore, she quantifies her uncertainty about by attaching a standard deviation of to her estimate. After consulting with an expert in statistics, the manager decides to use a Beta distribution to model her uncertainty about . How should she set the two parameters of the distribution in order to match her priors about the expected value and the standard deviation of ? Solution We know that the expected value of a Beta random variable with parameters and is while its variance is The two parameters need to be set in such a way that This is accomplished by finding a solution to the following system of two equations in two unknowns: where for notational convenience we have set and . The first equation gives or By substituting this into the second equation, we get or Then we divide the numerator and denominator on the left-hand side by : By computing the products, we get By taking the reciprocals of both sides, we have By multiplying both sides by , we obtain Thus the value of is and the value of is By plugging our numerical values into the two formulae, we obtain Exercise 2 After choosing the parameters of the Beta distribution so as to represent her priors about the probability of producing a defective item (see previous exercise), the plant manager now wants to update her priors by observing new data. She decides to inspect a production lot of 100 items, and she finds that 3 of the items in the lot are defective. How should she change the parameters of the Beta distribution in order to take this new information into account? Solution Under the hypothesis that the items are produced independently of each other, the result of the inspection is a binomial random variable with parameters and . But updating a Beta distribution based on the outcome of a binomial random variable gives as a result another Beta distribution. Moreover, the two parameters and of the updated Beta distribution are Exercise 3 After updating the parameters of the Beta distribution (see previous exercise), the plant manager wants to compute again the expected value and the standard deviation of the probability of finding a defective item. Can you help her? Solution We just need to use the formulae for the expected value and the variance of a Beta distribution: and plug in the new values we have found for and , that is, The result is How to cite Please cite as: Taboga, Marco (2021). "Beta distribution", Lectures on probability theory and mathematical statistics. Kindle Direct Publishing. Online appendix. https://www.statlect.com/probability-distributions/beta-distribution.
Markdown
![Search for probability and statistics terms on Statlect](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAXCAMAAADJPRQhAAACXlBMVEX///8zZpkyZZktY5guY5gxZZk0Z5kyZpkyZZgjWZAtYpchXJQcVo8tY5f//PgiWpE2XIkvY5ctZJkwZZksY5gmXpUlXJM0ZpklXZQkXJOpssJNbpbt5+csYpcvZJcmXZP79vQ6Y5H59fQjWpImXJItXpLX2N1OcpqUp78kV4wXUYuDk6saVI11h6NNbpUdVo8eV4+hrsFEbJf///7i4+d4kK6PrMmWpbgZVI6ToLW0vcoiU4cmVon69/fEx88YT4clWIxAa5oZUotAYo3Pz9Tt7O2vs8AZVY8nVYghWZExZZjt7fAHQn81Z5okXJSBlrAzXIovZJkoU4TEydMZVZAfVIrJ0NubrMAjWZEkWpD78OyuusseV5AeVIsrYJTe5e2ywdMjWpDu8fS2wtImWo/T2+Oqucqrucrx7Ovd2dsSUY20w9MdVIyxu8ppgqMoX5UjV4wQQ3szZprn5uk/ZpItZJgTTIcpYJZTdJpshqYcVo4iWpJ/katBZ5McU4q9xM/28/ImVooWUo5whKHn4uQ6Yo8mX5ZLbZX/+/k5Y5EvZJglXpYZTIJtiambqr6ouMuQorlNcJkTTYcuZJkrYpgoWIn18vIbToUeWJEpX5UjWpEeU4oxZpovV4f59vXg4ucjVIkuZJonVIa7wMtHa5QUTIYnX5X99vMvY5gsYZYfWZEdUIZxiqjR198nWIuGmbEkUYPd3+LO0tlsiatIcJw9aZg8bZ5AaZZUeqOVorfs7O7Cy9gkV4stZJojT4Ho5+n8+ff7/P3/+fYdSn359fNEa5YeS3769/X//vz69/Y1HbsLAAABU0lEQVR4Xm3JY5MrURiF0fN2x+bQtm3btm3btm1c2rbxr25V+mTSM5X96dm1EG02tXY+vo1G6PoMAl0trUx1xBGRUVfAwnBADgkMoQkBxg6ONDAz1wOmm7WHbbi9PrCdnDXiogeKIPdEhDy9vA+PwM9fDQECYMQF4xMSCsywTiySbqI4GqkXE6sb/4RKUVJySirSLC1dnkFVZhZk59AkN4/IL1BVYRGnpJQmZWJOeYWqKgVQVU2TGi7BrVNVfQOrqZkmLa1EG872DrJLA3d6oLcPd78SBocuZVgBI6O4x8YJmJikempaCTOzCG9ufgF0F5eWV1bX1jc2YWtbhGFnV8jcY7DY+/oHOjwWm398guH0jDy/uHHz1m2eVHr33v0HDxHeo8ek7OkzhJ6/ePnq9Zu3796r4cNH8tPnL1R//fYdaSbhy378RFr36/cfpH1//2mF/6EqUMbQOA8lAAAAAElFTkSuQmCC) [StatLect](https://www.statlect.com/) [Index](https://www.statlect.com/) \> [Probability distributions](https://www.statlect.com/probability-distributions/) # Beta distribution by [Marco Taboga](https://www.statlect.com/about/#author), PhD The Beta distribution is a continuous probability distribution often used to model the uncertainty about the probability of success of an experiment. ![Table of Contents](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAYCAIAAACJPGHrAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABJSURBVEhLY/z//z8DDQATlKY2GGrmgsL3yJEjUB4Dg42NDZBEFiEeQPRCwGj4QsBQS7+j6QECRtMDBIymBwgYTQ8QMLTMZWAAAEw6JxXCQPIuAAAAAElFTkSuQmCC) Table of contents 1. [How the distribution is used](https://www.statlect.com/probability-distributions/beta-distribution#hid2) 1. [Uncertainty about the probability of success](https://www.statlect.com/probability-distributions/beta-distribution#hid3) 2. [Data collection](https://www.statlect.com/probability-distributions/beta-distribution#hid4) 3. [Updating of priors](https://www.statlect.com/probability-distributions/beta-distribution#hid5) 2. [Definition](https://www.statlect.com/probability-distributions/beta-distribution#hid6) 3. [Expected value](https://www.statlect.com/probability-distributions/beta-distribution#hid7) 4. [Variance](https://www.statlect.com/probability-distributions/beta-distribution#hid8) 5. [Higher moments](https://www.statlect.com/probability-distributions/beta-distribution#hid9) 6. [Moment generating function](https://www.statlect.com/probability-distributions/beta-distribution#hid10) 7. [Characteristic function](https://www.statlect.com/probability-distributions/beta-distribution#hid11) 8. [Distribution function](https://www.statlect.com/probability-distributions/beta-distribution#hid12) 9. [More details](https://www.statlect.com/probability-distributions/beta-distribution#hid13) 1. [Relation to the uniform distribution](https://www.statlect.com/probability-distributions/beta-distribution#hid14) 2. [Relation to the binomial distribution](https://www.statlect.com/probability-distributions/beta-distribution#hid15) 10. [Solved exercises](https://www.statlect.com/probability-distributions/beta-distribution#hid16) 1. [Exercise 1](https://www.statlect.com/probability-distributions/beta-distribution#hid17) 2. [Exercise 2](https://www.statlect.com/probability-distributions/beta-distribution#hid18) 3. [Exercise 3](https://www.statlect.com/probability-distributions/beta-distribution#hid19) ## How the distribution is used The Beta distribution can be used to analyze probabilistic experiments that have only two possible outcomes: - success, with probability ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==); - failure, with probability ![\$1-X\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). These experiments are called Bernoulli experiments. ![Flow chart showing how updating a uniform prior about the probability of success leads to a posterior having a Beta distribution.](https://www.statlect.com/images/beta-distribution.png) ### Uncertainty about the probability of success Suppose that ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is unknown and all its possible values are deemed equally likely. This uncertainty can be described by assigning to ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) a [uniform distribution](https://www.statlect.com/probability-distributions/uniform-distribution) on the interval ![\$left\[ 0,1 ight\] \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). This is appropriate because: - ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==), being a [probability](https://www.statlect.com/fundamentals-of-probability/probability), can take only values between ![0](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![1](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==); - the uniform distribution assigns equal probability density to all points in the interval, which reflects the fact that no possible value of ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is, a priori, deemed more likely than all the others. ### Data collection Now, suppose that: - we perform ![n](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) independent repetitions of the experiment; - we observe ![k](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) successes and ![\$n-k\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) failures. ### Updating of priors After performing the experiments, we want to know how we should revise the distribution initially assigned to ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==), in order to properly take into account the information provided by the observed outcomes. In other words, we want to calculate the [conditional distribution](https://www.statlect.com/fundamentals-of-probability/conditional-probability-distributions) of ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) (also called posterior distribution), conditional on the number of successes and failures we have observed. The result of this calculation is a Beta distribution. In particular, the conditional distribution of ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==), conditional on having observed ![k](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) successes out of ![n](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) trials, is a Beta distribution with parameters ![\$k+1\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$n-k+1\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). ## Definition The Beta distribution is characterized as follows. Definition Let ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) be a [continuous random variable](https://www.statlect.com/glossary/absolutely-continuous-random-variable). Let its [support](https://www.statlect.com/glossary/support-of-a-random-variable) be the unit interval:![\[eq1\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)Let ![\[eq2\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). We say that ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) has a **Beta distribution** with shape parameters ![\$alpha \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$beta \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) if and only if its [probability density function](https://www.statlect.com/glossary/probability-density-function) is![\[eq3\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)where ![\$Bleft( {} ight) \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is the [Beta function](https://www.statlect.com/mathematical-tools/beta-function). A random variable having a Beta distribution is also called a Beta random variable. The following is a proof that ![\[eq4\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is a [legitimate probability density function](https://www.statlect.com/fundamentals-of-probability/legitimate-probability-density-functions). Proof Non-negativity descends from the facts that ![\[eq5\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is non-negative when ![\[eq6\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\[eq7\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==), and that ![\[eq8\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is strictly positive (it is a ratio of Gamma functions, which are strictly positive when their arguments are strictly positive - see the lecture entitled [Gamma function](https://www.statlect.com/mathematical-tools/gamma-function)). That the integral of ![\[eq9\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) over ![R](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) equals ![1](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is proved as follows:![\[eq10\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)where we have used the integral representation ![\[eq11\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)a proof of which can be found in the lecture entitled [Beta function](https://www.statlect.com/mathematical-tools/beta-function). ## Expected value The [expected value](https://www.statlect.com/fundamentals-of-probability/expected-value) of a Beta random variable ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is![\[eq12\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) Proof It can be derived as follows:![\[eq13\]](https://www.statlect.com/images/beta-distribution__40.png) ## Variance The [variance](https://www.statlect.com/fundamentals-of-probability/variance) of a Beta random variable ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is![\[eq14\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) Proof It can be derived thanks to the usual [variance formula](https://www.statlect.com/glossary/variance-formula) (![\[eq15\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)):![\[eq16\]](https://www.statlect.com/images/beta-distribution__44.png) ## Higher moments The ![k](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)\-th [moment](https://www.statlect.com/fundamentals-of-probability/moments) of a Beta random variable ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is![\[eq17\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) Proof By the definition of moment, we have![\[eq18\]](https://www.statlect.com/images/beta-distribution__48.png) where in step ![\$frame{A}\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) we have used recursively the fact that ![\[eq19\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). ## Moment generating function The [moment generating function](https://www.statlect.com/fundamentals-of-probability/moment-generating-function) of a Beta random variable ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is defined for any ![\$t\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and it is![\[eq20\]](https://www.statlect.com/images/beta-distribution__53.png) Proof By using the definition of moment generating function, we obtain![\[eq21\]](https://www.statlect.com/images/beta-distribution__54.png)Note that the moment generating function exists and is well defined for any ![\$t\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) because the integral![\[eq22\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)is guaranteed to exist and be finite, since the integrand![\[eq23\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)is continuous in ![x](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) over the bounded interval ![\$left\[ 0,1 ight\] \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). The above formula for the moment generating function might seem impractical to compute because it involves an infinite sum as well as products whose number of terms increase indefinitely. However, the function![\[eq24\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)is a function, called [Confluent hypergeometric function of the first kind](http://mathworld.wolfram.com/ConfluentHypergeometricFunctionoftheFirstKind.html), that has been extensively studied in many branches of mathematics. Its properties are well-known and efficient algorithms for its computation are available in most software packages for scientific computation. ## Characteristic function The [characteristic function](https://www.statlect.com/fundamentals-of-probability/characteristic-function) of a Beta random variable ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is![\[eq25\]](https://www.statlect.com/images/beta-distribution__62.png) Proof The derivation of the characteristic function is almost identical to the derivation of the moment generating function (just replace ![\$t\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) with ![\$it\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) in that proof). Comments made about the moment generating function, including those about the computation of the Confluent hypergeometric function, apply also to the characteristic function, which is identical to the mgf except for the fact that ![\$t\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is replaced with ![\$it\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). ## Distribution function The distribution function of a Beta random variable ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is![\[eq26\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)where the function![\[eq27\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)is called [incomplete Beta function](https://www.statlect.com/mathematical-tools/beta-function#incomplete) and is usually computed by means of specialized computer algorithms. Proof For ![\$x\<0\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==), ![\[eq28\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==), because ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) cannot be smaller than ![0](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). For ![\$x\>1\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==), ![\[eq29\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) because ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is always smaller than or equal to ![1](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). For ![\[eq30\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==),![\[eq31\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) ## More details In the following subsections you can find more details about the Beta distribution. ### Relation to the uniform distribution The following proposition states the relation between the Beta and the uniform distributions. Proposition A Beta distribution with parameters ![\$alpha =1\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$beta =1\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is a uniform distribution on the interval ![\$left\[ 0,1 ight\] \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). Proof When ![\$alpha =1\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$beta =1\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==), we have that ![\[eq32\]](https://www.statlect.com/images/beta-distribution__85.png)Therefore, the probability density function of a Beta distribution with parameters ![\$alpha =1\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$beta =1\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) can be written as ![\[eq33\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)But the latter is the probability density function of a uniform distribution on the interval ![\$left\[ 0,1 ight\] \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). ### Relation to the binomial distribution The following proposition states the relation between the Beta and the binomial distributions. Proposition Suppose ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is a random variable having a Beta distribution with parameters ![\$alpha \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$beta \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). Let ![Y](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) be another random variable such that its distribution conditional on ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is a [binomial distribution](https://www.statlect.com/probability-distributions/binomial-distribution) with parameters ![n](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). Then, the conditional distribution of ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) given ![Y=y](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is a Beta distribution with parameters ![\$alpha +y\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$beta +n-y\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). Proof We are dealing with one continuous random variable ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and one discrete random variable ![Y](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) (together, they form what is called a random vector with mixed coordinates). With a slight abuse of notation, we will proceed as if also ![Y](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) were continuous, treating its probability mass function as if it were a probability density function. Rest assured that this can be made fully rigorous (by defining a probability density function with respect to a [counting measure](https://en.wikipedia.org/wiki/Counting_measure) on the support of ![Y](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)). By assumption ![Y](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) has a binomial distribution conditional on ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==), so that its [conditional probability mass function](https://www.statlect.com/glossary/conditional-probability-mass-function) is ![\[eq34\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)where ![\$binom{n}{y}\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is a [binomial coefficient](https://www.statlect.com/glossary/binomial-coefficient). Also, by assumption ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) has a Beta distribution, so that is probability density function is![\[eq35\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)Therefore, the [joint probability density function](https://www.statlect.com/glossary/joint-probability-density-function) of ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![Y](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is ![\[eq36\]](https://www.statlect.com/images/beta-distribution__113.png)Thus, we have factored the joint probability density function as![\[eq37\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)where![\[eq38\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)is the probability density function of a Beta distribution with parameters ![\$alpha +y\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$beta +n-y\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==), and the function ![\[eq39\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) does not depend on ![x](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). By a result proved in the lecture entitled [Factorization of joint probability density functions](https://www.statlect.com/fundamentals-of-probability/factorization-of-joint-probability-density-functions), this implies that the probability density function of ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) given ![Y=y](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is![\[eq40\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)Thus, as we wanted to demonstrate, the conditional distribution of ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) given ![Y=y](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is a Beta distribution with parameters ![\$alpha +y\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$beta +n-y\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). By combining this proposition and the previous one, we obtain the following corollary. Proposition Suppose that ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is a random variable having a uniform distribution. Let ![Y](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) be another random variable such that its distribution conditional on ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is a binomial distribution with parameters ![n](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). Then, the conditional distribution of ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) given ![Y=y](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is a Beta distribution with parameters ![\$1+y\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$1+n-y\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). This proposition constitutes a formal statement of what we said in the introduction of this lecture in order to motivate the Beta distribution. Remember that the number of successes obtained in ![n](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) independent repetitions of a random experiment having probability of success ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is a binomial random variable with parameters ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![n](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). According to the proposition above, when the probability of success ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is a priori unknown and all possible values of ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) are deemed equally likely (they have a uniform distribution), observing the outcome of the ![n](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) experiments leads us to revise the distribution assigned to ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==), and the result of this revision is a Beta distribution. ## Solved exercises Below you can find some exercises with explained solutions. ### Exercise 1 A production plant produces items that have a probability ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) of being defective. The plant manager does not know ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==), but from past experience she expects this probability to be equal to ![\$4%\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). Furthermore, she quantifies her uncertainty about ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) by attaching a [standard deviation](https://www.statlect.com/glossary/standard-deviation) of ![\$2%\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) to her ![\$4%\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) estimate. After consulting with an expert in statistics, the manager decides to use a Beta distribution to model her uncertainty about ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). How should she set the two parameters of the distribution in order to match her priors about the expected value and the standard deviation of ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)? Solution We know that the expected value of a Beta random variable with parameters ![\$alpha \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$beta \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is![\[eq41\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)while its variance is![\[eq42\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)The two parameters need to be set in such a way that![\[eq43\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)This is accomplished by finding a solution to the following system of two equations in two unknowns:![\[eq44\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)where for notational convenience we have set ![\$mu =0.04\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$sigma ^{2}=0.0004\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). The first equation gives![\[eq45\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)or![\[eq46\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)By substituting this into the second equation, we get![\[eq47\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)or![\[eq48\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)Then we divide the numerator and denominator on the left-hand side by ![\$alpha ^{2}\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==):![\[eq49\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)By computing the products, we get![\[eq50\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)By taking the reciprocals of both sides, we have![\[eq51\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)By multiplying both sides by ![\$mu ^{3}\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==), we obtain![\[eq52\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)Thus the value of ![\$alpha \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is![\[eq53\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)and the value of ![\$beta \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is![\[eq54\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)By plugging our numerical values into the two formulae, we obtain![\[eq55\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) ### Exercise 2 After choosing the parameters of the Beta distribution so as to represent her priors about the probability of producing a defective item (see previous exercise), the plant manager now wants to update her priors by observing new data. She decides to inspect a production lot of 100 items, and she finds that 3 of the items in the lot are defective. How should she change the parameters of the Beta distribution in order to take this new information into account? Solution Under the hypothesis that the items are produced independently of each other, the result of the inspection is a binomial random variable with parameters ![\$n=100\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$p=X\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). But updating a Beta distribution based on the outcome of a binomial random variable gives as a result another Beta distribution. Moreover, the two parameters ![\$alpha \_{1}\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$beta \_{1}\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) of the updated Beta distribution are![\[eq56\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) ### Exercise 3 After updating the parameters of the Beta distribution (see previous exercise), the plant manager wants to compute again the expected value and the standard deviation of the probability of finding a defective item. Can you help her? Solution We just need to use the formulae for the expected value and the variance of a Beta distribution:![\[eq57\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)and plug in the new values we have found for ![\$alpha \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$beta \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==), that is,![\[eq58\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)The result is![\[eq59\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) ## How to cite Please cite as: Taboga, Marco (2021). "Beta distribution", Lectures on probability theory and mathematical statistics. Kindle Direct Publishing. Online appendix. https://www.statlect.com/probability-distributions/beta-distribution. The books Most of the learning materials found on this website are now available in a traditional textbook format. [Probability and statistics](https://www.statlect.com/about/book)[Matrix algebra](https://www.statlect.com/about/linear-algebra-book) Featured pages - [Likelihood ratio test](https://www.statlect.com/fundamentals-of-statistics/likelihood-ratio-test) - [Conditional probability](https://www.statlect.com/fundamentals-of-probability/conditional-probability) - [Point estimation](https://www.statlect.com/fundamentals-of-statistics/point-estimation) - [Convergence in probability](https://www.statlect.com/asymptotic-theory/convergence-in-probability) - [Delta method](https://www.statlect.com/asymptotic-theory/delta-method) - [F distribution](https://www.statlect.com/probability-distributions/F-distribution) Explore - [Independent events](https://www.statlect.com/fundamentals-of-probability/independent-events) - [Bayes rule](https://www.statlect.com/fundamentals-of-probability/Bayes-rule) - [Set estimation](https://www.statlect.com/fundamentals-of-statistics/set-estimation) Main sections - [Mathematical tools](https://www.statlect.com/mathematical-tools/) - [Fundamentals of probability](https://www.statlect.com/fundamentals-of-probability/) - [Probability distributions](https://www.statlect.com/probability-distributions/) - [Asymptotic theory](https://www.statlect.com/asymptotic-theory/) - [Fundamentals of statistics](https://www.statlect.com/fundamentals-of-statistics/) - [Glossary](https://www.statlect.com/glossary/) About - [About Statlect](https://www.statlect.com/about/) - [Contacts](https://www.statlect.com/about/contacts) - [Cookies, privacy and terms of use](https://www.statlect.com/about/cookies-privacy-policy-and-terms-of-use) Glossary entries - [IID sequence](https://www.statlect.com/glossary/IID-sequence) - [Discrete random variable](https://www.statlect.com/glossary/discrete-random-variable) - [Type II error](https://www.statlect.com/glossary/Type-II-error) - [Mean squared error](https://www.statlect.com/glossary/mean-squared-error) - [Loss function](https://www.statlect.com/glossary/loss-function) - [Continuous mapping theorem](https://www.statlect.com/asymptotic-theory/continuous-mapping-theorem) Share - To enhance your privacy, - we removed the social buttons, - but **don't forget to share**.
Readable Markdown
The Beta distribution is a continuous probability distribution often used to model the uncertainty about the probability of success of an experiment. ![Table of Contents](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAYCAIAAACJPGHrAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABJSURBVEhLY/z//z8DDQATlKY2GGrmgsL3yJEjUB4Dg42NDZBEFiEeQPRCwGj4QsBQS7+j6QECRtMDBIymBwgYTQ8QMLTMZWAAAEw6JxXCQPIuAAAAAElFTkSuQmCC) Table of contents 1. [How the distribution is used](https://www.statlect.com/probability-distributions/beta-distribution#hid2) 1. [Uncertainty about the probability of success](https://www.statlect.com/probability-distributions/beta-distribution#hid3) 2. [Data collection](https://www.statlect.com/probability-distributions/beta-distribution#hid4) 3. [Updating of priors](https://www.statlect.com/probability-distributions/beta-distribution#hid5) 2. [Definition](https://www.statlect.com/probability-distributions/beta-distribution#hid6) 3. [Expected value](https://www.statlect.com/probability-distributions/beta-distribution#hid7) 4. [Variance](https://www.statlect.com/probability-distributions/beta-distribution#hid8) 5. [Higher moments](https://www.statlect.com/probability-distributions/beta-distribution#hid9) 6. [Moment generating function](https://www.statlect.com/probability-distributions/beta-distribution#hid10) 7. [Characteristic function](https://www.statlect.com/probability-distributions/beta-distribution#hid11) 8. [Distribution function](https://www.statlect.com/probability-distributions/beta-distribution#hid12) 9. [More details](https://www.statlect.com/probability-distributions/beta-distribution#hid13) 1. [Relation to the uniform distribution](https://www.statlect.com/probability-distributions/beta-distribution#hid14) 2. [Relation to the binomial distribution](https://www.statlect.com/probability-distributions/beta-distribution#hid15) 10. [Solved exercises](https://www.statlect.com/probability-distributions/beta-distribution#hid16) 1. [Exercise 1](https://www.statlect.com/probability-distributions/beta-distribution#hid17) 2. [Exercise 2](https://www.statlect.com/probability-distributions/beta-distribution#hid18) 3. [Exercise 3](https://www.statlect.com/probability-distributions/beta-distribution#hid19) ## How the distribution is used The Beta distribution can be used to analyze probabilistic experiments that have only two possible outcomes: - success, with probability ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==); - failure, with probability ![\$1-X\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). These experiments are called Bernoulli experiments. ![Flow chart showing how updating a uniform prior about the probability of success leads to a posterior having a Beta distribution.](https://www.statlect.com/images/beta-distribution.png) ### Uncertainty about the probability of success Suppose that ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is unknown and all its possible values are deemed equally likely. This uncertainty can be described by assigning to ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) a [uniform distribution](https://www.statlect.com/probability-distributions/uniform-distribution) on the interval ![\$left\[ 0,1 ight\] \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). This is appropriate because: - ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==), being a [probability](https://www.statlect.com/fundamentals-of-probability/probability), can take only values between ![0](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![1](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==); - the uniform distribution assigns equal probability density to all points in the interval, which reflects the fact that no possible value of ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is, a priori, deemed more likely than all the others. ### Data collection Now, suppose that: - we perform ![n](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) independent repetitions of the experiment; - we observe ![k](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) successes and ![\$n-k\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) failures. ### Updating of priors After performing the experiments, we want to know how we should revise the distribution initially assigned to ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==), in order to properly take into account the information provided by the observed outcomes. In other words, we want to calculate the [conditional distribution](https://www.statlect.com/fundamentals-of-probability/conditional-probability-distributions) of ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) (also called posterior distribution), conditional on the number of successes and failures we have observed. The result of this calculation is a Beta distribution. In particular, the conditional distribution of ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==), conditional on having observed ![k](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) successes out of ![n](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) trials, is a Beta distribution with parameters ![\$k+1\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$n-k+1\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). ## Definition The Beta distribution is characterized as follows. A random variable having a Beta distribution is also called a Beta random variable. The following is a proof that ![\[eq4\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is a [legitimate probability density function](https://www.statlect.com/fundamentals-of-probability/legitimate-probability-density-functions). Proof ## Expected value The [expected value](https://www.statlect.com/fundamentals-of-probability/expected-value) of a Beta random variable ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is![\[eq12\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) Proof It can be derived as follows:![\[eq13\]](https://www.statlect.com/images/beta-distribution__40.png) ## Variance The [variance](https://www.statlect.com/fundamentals-of-probability/variance) of a Beta random variable ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is![\[eq14\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) Proof ## Higher moments The ![k](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)\-th [moment](https://www.statlect.com/fundamentals-of-probability/moments) of a Beta random variable ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is![\[eq17\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) Proof By the definition of moment, we have![\[eq18\]](https://www.statlect.com/images/beta-distribution__48.png) where in step ![\$frame{A}\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) we have used recursively the fact that ![\[eq19\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). ## Moment generating function The [moment generating function](https://www.statlect.com/fundamentals-of-probability/moment-generating-function) of a Beta random variable ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is defined for any ![\$t\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and it is![\[eq20\]](https://www.statlect.com/images/beta-distribution__53.png) Proof The above formula for the moment generating function might seem impractical to compute because it involves an infinite sum as well as products whose number of terms increase indefinitely. However, the function![\[eq24\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)is a function, called [Confluent hypergeometric function of the first kind](http://mathworld.wolfram.com/ConfluentHypergeometricFunctionoftheFirstKind.html), that has been extensively studied in many branches of mathematics. Its properties are well-known and efficient algorithms for its computation are available in most software packages for scientific computation. ## Characteristic function The [characteristic function](https://www.statlect.com/fundamentals-of-probability/characteristic-function) of a Beta random variable ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is![\[eq25\]](https://www.statlect.com/images/beta-distribution__62.png) Proof The derivation of the characteristic function is almost identical to the derivation of the moment generating function (just replace ![\$t\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) with ![\$it\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) in that proof). Comments made about the moment generating function, including those about the computation of the Confluent hypergeometric function, apply also to the characteristic function, which is identical to the mgf except for the fact that ![\$t\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is replaced with ![\$it\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). ## Distribution function The distribution function of a Beta random variable ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is![\[eq26\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)where the function![\[eq27\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)is called [incomplete Beta function](https://www.statlect.com/mathematical-tools/beta-function#incomplete) and is usually computed by means of specialized computer algorithms. Proof ## More details In the following subsections you can find more details about the Beta distribution. ### Relation to the uniform distribution The following proposition states the relation between the Beta and the uniform distributions. Proposition A Beta distribution with parameters ![\$alpha =1\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$beta =1\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is a uniform distribution on the interval ![\$left\[ 0,1 ight\] \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). Proof ### Relation to the binomial distribution The following proposition states the relation between the Beta and the binomial distributions. Proposition Suppose ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is a random variable having a Beta distribution with parameters ![\$alpha \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$beta \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). Let ![Y](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) be another random variable such that its distribution conditional on ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is a [binomial distribution](https://www.statlect.com/probability-distributions/binomial-distribution) with parameters ![n](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). Then, the conditional distribution of ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) given ![Y=y](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is a Beta distribution with parameters ![\$alpha +y\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$beta +n-y\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). Proof We are dealing with one continuous random variable ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and one discrete random variable ![Y](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) (together, they form what is called a random vector with mixed coordinates). With a slight abuse of notation, we will proceed as if also ![Y](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) were continuous, treating its probability mass function as if it were a probability density function. Rest assured that this can be made fully rigorous (by defining a probability density function with respect to a [counting measure](https://en.wikipedia.org/wiki/Counting_measure) on the support of ![Y](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)). By assumption ![Y](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) has a binomial distribution conditional on ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==), so that its [conditional probability mass function](https://www.statlect.com/glossary/conditional-probability-mass-function) is ![\[eq34\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)where ![\$binom{n}{y}\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is a [binomial coefficient](https://www.statlect.com/glossary/binomial-coefficient). Also, by assumption ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) has a Beta distribution, so that is probability density function is![\[eq35\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)Therefore, the [joint probability density function](https://www.statlect.com/glossary/joint-probability-density-function) of ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![Y](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is ![\[eq36\]](https://www.statlect.com/images/beta-distribution__113.png)Thus, we have factored the joint probability density function as![\[eq37\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)where![\[eq38\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)is the probability density function of a Beta distribution with parameters ![\$alpha +y\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$beta +n-y\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==), and the function ![\[eq39\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) does not depend on ![x](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). By a result proved in the lecture entitled [Factorization of joint probability density functions](https://www.statlect.com/fundamentals-of-probability/factorization-of-joint-probability-density-functions), this implies that the probability density function of ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) given ![Y=y](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is![\[eq40\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)Thus, as we wanted to demonstrate, the conditional distribution of ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) given ![Y=y](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is a Beta distribution with parameters ![\$alpha +y\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$beta +n-y\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). By combining this proposition and the previous one, we obtain the following corollary. Proposition Suppose that ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is a random variable having a uniform distribution. Let ![Y](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) be another random variable such that its distribution conditional on ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is a binomial distribution with parameters ![n](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). Then, the conditional distribution of ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) given ![Y=y](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is a Beta distribution with parameters ![\$1+y\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$1+n-y\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). This proposition constitutes a formal statement of what we said in the introduction of this lecture in order to motivate the Beta distribution. Remember that the number of successes obtained in ![n](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) independent repetitions of a random experiment having probability of success ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is a binomial random variable with parameters ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![n](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). According to the proposition above, when the probability of success ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is a priori unknown and all possible values of ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) are deemed equally likely (they have a uniform distribution), observing the outcome of the ![n](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) experiments leads us to revise the distribution assigned to ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==), and the result of this revision is a Beta distribution. ## Solved exercises Below you can find some exercises with explained solutions. ### Exercise 1 A production plant produces items that have a probability ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) of being defective. The plant manager does not know ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==), but from past experience she expects this probability to be equal to ![\$4%\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). Furthermore, she quantifies her uncertainty about ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) by attaching a [standard deviation](https://www.statlect.com/glossary/standard-deviation) of ![\$2%\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) to her ![\$4%\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) estimate. After consulting with an expert in statistics, the manager decides to use a Beta distribution to model her uncertainty about ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). How should she set the two parameters of the distribution in order to match her priors about the expected value and the standard deviation of ![X](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)? Solution We know that the expected value of a Beta random variable with parameters ![\$alpha \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$beta \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is![\[eq41\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)while its variance is![\[eq42\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)The two parameters need to be set in such a way that![\[eq43\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)This is accomplished by finding a solution to the following system of two equations in two unknowns:![\[eq44\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)where for notational convenience we have set ![\$mu =0.04\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$sigma ^{2}=0.0004\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). The first equation gives![\[eq45\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)or![\[eq46\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)By substituting this into the second equation, we get![\[eq47\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)or![\[eq48\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)Then we divide the numerator and denominator on the left-hand side by ![\$alpha ^{2}\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==):![\[eq49\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)By computing the products, we get![\[eq50\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)By taking the reciprocals of both sides, we have![\[eq51\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)By multiplying both sides by ![\$mu ^{3}\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==), we obtain![\[eq52\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)Thus the value of ![\$alpha \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is![\[eq53\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)and the value of ![\$beta \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) is![\[eq54\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)By plugging our numerical values into the two formulae, we obtain![\[eq55\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) ### Exercise 2 After choosing the parameters of the Beta distribution so as to represent her priors about the probability of producing a defective item (see previous exercise), the plant manager now wants to update her priors by observing new data. She decides to inspect a production lot of 100 items, and she finds that 3 of the items in the lot are defective. How should she change the parameters of the Beta distribution in order to take this new information into account? Solution Under the hypothesis that the items are produced independently of each other, the result of the inspection is a binomial random variable with parameters ![\$n=100\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$p=X\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==). But updating a Beta distribution based on the outcome of a binomial random variable gives as a result another Beta distribution. Moreover, the two parameters ![\$alpha \_{1}\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$beta \_{1}\$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) of the updated Beta distribution are![\[eq56\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) ### Exercise 3 After updating the parameters of the Beta distribution (see previous exercise), the plant manager wants to compute again the expected value and the standard deviation of the probability of finding a defective item. Can you help her? Solution We just need to use the formulae for the expected value and the variance of a Beta distribution:![\[eq57\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)and plug in the new values we have found for ![\$alpha \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) and ![\$beta \$](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==), that is,![\[eq58\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)The result is![\[eq59\]](data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==) ## How to cite Please cite as: Taboga, Marco (2021). "Beta distribution", Lectures on probability theory and mathematical statistics. Kindle Direct Publishing. Online appendix. https://www.statlect.com/probability-distributions/beta-distribution.
Shard126 (laksa)
Root Hash3586688910177265926
Unparsed URLcom,statlect!www,/probability-distributions/beta-distribution s443