JenniferMurphy
Well-known Member
- Joined
- Jul 23, 2011
- Messages
- 2,691
- Office Version
- 365
- Platform
- Windows
It looks like the Beta distribution, with the right values for alpha and beta, can have a shape similar to a Normal distribution, but with finite tails.
Unfortunately, the m$ft description of the Beta.Dist function leaves a little to be desired. There are 5 parameters:
And if I make one of them larger than the other, it skews the curve left or right.
I also learned that the mean = 1/(1+(beta/alpha)).
I have a few questions:
1. Can someone explain the two parameters, Alpha & Beta? In particular, what values most closely approximate a Normal (Guassian) distribution (symmetrical and skewed)?
2. The Beta.Dist function has two forms: Cumulative=True, which is a cumulative distribution function (CDF) and Cumulative=False, which is a probability distribution function (PDF). It seems pretty that the CDF chart shows the cumulative probabilities. It starts at zero and progresses monotonically to "1". But what the heck is the PDF? It can't be a probability. It goes well past 1 and the sum (G18) is almost 10. In column C, I tried normalizing the Y values by dividing them by the sum (G18). Now they do sum to "1", so are these the probabilities? In column D, I calculated the cumulative values. They do add up to "1", but they do not agree with the CDF values in column P as shown in column E. I would really like to understand what the PDF values are.
3. How can I write some VBA code (=XBeta(alpha, beta, a, b)) that will return X, a random number that has a probability distribution equal to the Beta distribution with those parameters? If I call my XBeta UDF 100 or 1,000 times, the set of numbers returned will have that distribution and that mean. This is my most important question.
I have started a sheet to try and analyze the Beta distribution. It's what I used to generate the charts above. Here's the mini-sheet. It does not appear to include the charts.
Unfortunately, the m$ft description of the Beta.Dist function leaves a little to be desired. There are 5 parameters:
- X Required. The value between A and B at which to evaluate the function
- Alpha Required. A parameter of the distribution.
- Beta Required. A parameter of the distribution.
- Cumulative Required. A logical value that determines the form of the function. If cumulative is TRUE, BETA.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.
- A Optional. A lower bound to the interval of x.
- B Optional. An upper bound to the interval of x.
And if I make one of them larger than the other, it skews the curve left or right.
I also learned that the mean = 1/(1+(beta/alpha)).
I have a few questions:
1. Can someone explain the two parameters, Alpha & Beta? In particular, what values most closely approximate a Normal (Guassian) distribution (symmetrical and skewed)?
2. The Beta.Dist function has two forms: Cumulative=True, which is a cumulative distribution function (CDF) and Cumulative=False, which is a probability distribution function (PDF). It seems pretty that the CDF chart shows the cumulative probabilities. It starts at zero and progresses monotonically to "1". But what the heck is the PDF? It can't be a probability. It goes well past 1 and the sum (G18) is almost 10. In column C, I tried normalizing the Y values by dividing them by the sum (G18). Now they do sum to "1", so are these the probabilities? In column D, I calculated the cumulative values. They do add up to "1", but they do not agree with the CDF values in column P as shown in column E. I would really like to understand what the PDF values are.
3. How can I write some VBA code (=XBeta(alpha, beta, a, b)) that will return X, a random number that has a probability distribution equal to the Beta distribution with those parameters? If I call my XBeta UDF 100 or 1,000 times, the set of numbers returned will have that distribution and that mean. This is my most important question.
I have started a sheet to try and analyze the Beta distribution. It's what I used to generate the charts above. Here's the mini-sheet. It does not appear to include the charts.
Normal-like function.xlsx | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | |||
2 | B | C | D | E | R/C | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | ||
3 | 3 | Alpha | Beta | Cum | A | B | Mean | 3 | Alpha | Beta | Cum | A | B | Mean | ||||||||||
4 | 4 | 3 | 3 | FALSE | 0 | 1 | 0.5000 | 4 | 3 | 3 | TRUE | 0 | 1 | 0.5000 | ||||||||||
5 | 5 | 5 | ||||||||||||||||||||||
6 | Beta.Inv | P(X) | Cum | Δ | 6 | X | F(X) | 6 | X | F(X) | ||||||||||||||
7 | #NUM! | 0.0000 | 0.0000000 | 0 | 7 | 0.00 | 0 | 7 | 0.00 | 0 | ||||||||||||||
8 | 0.2466 | 0.0243 | 0.0243024 | -0.0157 | 8 | 0.10 | 0.2430 | 8 | 0.10 | 0.00856 | ||||||||||||||
9 | 0.3266 | 0.0768 | 0.1011101 | -0.0432 | 9 | 0.20 | 0.7680 | 9 | 0.20 | 0.05792 | ||||||||||||||
10 | 0.3898 | 0.1323 | 0.2334233 | -0.0703 | 10 | 0.30 | 1.3230 | 10 | 0.30 | 0.16308 | ||||||||||||||
11 | 0.4463 | 0.1728 | 0.4062406 | -0.0888 | 11 | 0.40 | 1.7280 | 11 | 0.40 | 0.31744 | ||||||||||||||
12 | 0.5000 | 0.1875 | 0.5937594 | -0.0938 | 12 | 0.50 | 1.8750 | 12 | 0.50 | 0.50000 | ||||||||||||||
13 | 0.5537 | 0.1728 | 0.7665767 | -0.0840 | 13 | 0.60 | 1.7280 | 13 | 0.60 | 0.68256 | ||||||||||||||
14 | 0.6102 | 0.1323 | 0.8988899 | -0.0620 | 14 | 0.70 | 1.3230 | 14 | 0.70 | 0.83692 | ||||||||||||||
15 | 0.6734 | 0.0768 | 0.9756976 | -0.0336 | 15 | 0.80 | 0.7680 | 15 | 0.80 | 0.94208 | ||||||||||||||
16 | 0.7534 | 0.0243 | 1.0000000 | -0.0086 | 16 | 0.90 | 0.2430 | 16 | 0.90 | 0.99144 | ||||||||||||||
17 | #NUM! | 0.0000 | 1.0000000 | 0 | 17 | 1.00 | 0 | 17 | 1.00 | 1 | ||||||||||||||
18 | Sum | 1.0000 | 18 | Sum | 9.9990 | 18 | ||||||||||||||||||
Beta.Dist |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B2:E2,G2:W2 | B2 | =col() |
L4,U4 | L4 | =1/(1+(Beta/Alpha)) |
P4 | P4 | =Alpha |
Q4 | Q4 | =Beta |
S4 | S4 | =A |
T4 | T4 | =B |
D7 | D7 | =ProbX |
E7:E17 | E7 | =Q7-D7 |
D8:D17 | D8 | =OFFSET(D8,-1,0)+ProbX |
P7:P17 | P7 | =X |
Q7:Q17 | Q7 | =BETA.DIST(X,Alpha,Beta,CumTrue,A,B) |
B7:B17 | B7 | =BETA.INV(X,Alpha,Beta,A,B) |
C7:C17 | C7 | =H7/SumYFalse |
C18,H18 | C18 | =SUM(C7:C17) |
F3:F18,O3:O18 | F3 | =ROW() |
H7:H17 | H7 | =BETA.DIST(X,Alpha,Beta,CumFalse,A,B) |
Named Ranges | ||
---|---|---|
Name | Refers To | Cells |
A | =Beta.Dist!$J$4 | S4, B7:B17, H7:H17, Q7:Q17 |
Alpha | =Beta.Dist!$G$4 | U4, P4, L4, B7:B17, H7:H17, Q7:Q17 |
B | =Beta.Dist!$K$4 | T4, B7:B17, H7:H17, Q7:Q17 |
Beta | =Beta.Dist!$H$4 | U4, Q4, L4, B7:B17, H7:H17, Q7:Q17 |
CumFalse | =Beta.Dist!$I$4 | H7:H17 |
CumTrue | =Beta.Dist!$R$4 | Q7:Q17 |
ProbX | =Beta.Dist!$C$7:$C$17 | C18, D7 |
SumYFalse | =Beta.Dist!$H$18 | C7:C17 |
X | =Beta.Dist!$G$7:$G$17 | H7, P7:Q7, B7 |