RANDBETA Function (Gnumeric)
RANDBETA(a,b) requires two positive shape parameters. It forms a ratio of gamma variates; b is not a scale or an upper limit.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: RANDBETA(a,b) requires two positive shape parameters. It forms a ratio of gamma variates; b is not a scale or an upper limit.
Syntax
=RANDBETA(a,b)
Availability and evidence
- Introduction: Gnumeric 1.1.6 NEWS explicitly lists this new function. This release-history evidence is separate from a native test of that old version.
- Source support: Registered in the Gnumeric 1.12.62 random plugin. No retirement is established; the last functioning native application version is unverified.
- Evidence dates: Official Gnumeric source retained October 13–14, 2026 was reviewed October 15. Mathematical controls were independently recalculated October 15. No native application, compiled Gnumeric helper or random generator was executed.
Parameters and source contract
Both a and b are required and strictly positive. Either shape zero or negative produces #NUM!. The helper generates two gamma quantities with common scale 1, then returns X/(X+Y), using shapes a and b respectively.
The ideal beta distribution lies between 0 and 1. Its mean is a/(a+b) and variance is a*b/((a+b)^2*(a+b+1)). The second argument controls shape, not units. Unlike RANDGAMMA’s second parameter, it is not a scale parameter.
Complete worksheet setup
Create BetaControls. Put first shape 2 in B2 and second shape 5 in B3. In D2 enter =RANDBETA($B$2,$B$3). D2 is a changing variate, not a fixed fraction 2/7.
In F2 enter =B2/(B2+B3) and in F3 enter =B2*B3/((B2+B3)^2*(B2+B3+1)). The ideal mean is approximately 0.285714285714, and variance approximately 0.0255102040816. The ideal mode is (a-1)/(a+b-2) when both shapes exceed 1, giving 0.2 here.
Deterministic ratio controls
Put the following supplied positive X and Y pairs in A7:B10. In C7 enter =A7/(A7+B7) and fill down:
| Supplied control inputs | Independent reference result |
|---|---|
| X=1, Y=1 | 0.5 |
| X=2, Y=5 | 0.2857142857143 |
| X=5, Y=2 | 0.7142857142857 |
| X=1, Y=9 | 0.1 |
These pairs are fixed arithmetic controls, not gamma draws. The pair 2,5 happens to give the ideal mean 2/7, but the random algorithm does not substitute its gamma means on every call. In general, a mean of ratios must not be replaced by the ratio of means without a valid distributional derivation.
Advanced: reverse the two shapes
Swapping a and b reflects the ideal distribution about 0.5. The ideal mean becomes 5/7, approximately 0.714285714286, while variance is unchanged. For the same supplied pair, Y/(X+Y) equals 1 minus X/(X+Y).
This is a deterministic complement identity. Two separate calls RANDBETA(2,5) and RANDBETA(5,2) do not promise results that sum to 1 because they do not promise shared gamma draws.
For equal positive shapes the ideal distribution is symmetric about 0.5. With a=b=1 it is uniform on the unit interval. Shapes below 1 are valid and produce a different concentration pattern; they should not be rounded to integer counts.
Advanced: change concentration while preserving the mean
Multiplying both shapes by 10 changes 2,5 to 20,50. The ideal mean remains 2/7, while variance becomes approximately 0.0028743891923, smaller than the original variance. Keeping the ratio of shapes fixed does not keep the whole distribution fixed.
This distinguishes average fraction from concentration. A model requiring a particular spread cannot be specified by the mean alone; both positive shapes are needed.
Advanced: rescale a fraction to another interval
For an illustrative interval 10 through 30, define a transformed value =10+20*D2. Its ideal mean is approximately 15.7142857143 and variance approximately 10.2040816327. The linear multiplier changes variance by its square,20².
The function itself still generates a unit-interval model. Putting 10 and 30 directly into RANDBETA would set two shapes and would not change its output units to the interval 10–30.
Error and finite-precision boundaries
=RANDBETA(0,5), =RANDBETA(2,0), =RANDBETA(-1,5) and =RANDBETA(2,-1) are #NUM! controls. There is no zero-shape degenerate extension in this helper.
The ideal open-interval support does not prove every machine result lies strictly between 0 and 1: gamma underflow, rounding of the ratio or a non-finite intermediate can affect extreme inputs. In particular, a zero-over-zero intermediate would become a numerical error. The worked shapes are ordinary positive values, and no native extreme-shape reliability claim is made.
Recalculation and evidence limits
The plugin registers this function as volatile, so recalculation can replace its result. There is no worksheet seed argument in the signature shown here. Exact GUI triggers, saved-file replay and cross-application transfer were not tested. Two calls do not promise the same underlying driver; repeated references to one random cell do not create independent observations.
The supplied driver values and mathematical summaries are deterministic teaching controls. They are not captured random samples. Ideal continuous distributions differ from a finite-resolution generator: rounding, underflow, overflow and endpoint treatment can matter. Non-finite arithmetic is converted to #NUM! by the numeric result constructor. Explicit finite numeric inputs are used throughout; text/blank coercion and locale-sensitive parsing are outside this verification.