Contact

RANDRAYLEIGH Function (Gnumeric)

Statistical Intermediate Gnumeric Gnumeric 1.1.6

RANDRAYLEIGH(sigma) uses a nonnegative scale. With scale 3, the ideal mean is about 3.75994, not 3; its positive-scale output models a magnitude rather than a signed normal value.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: RANDRAYLEIGH(sigma) uses a nonnegative scale. With scale 3, the ideal mean is about 3.75994, not 3; its positive-scale output models a magnitude rather than a signed normal value.

Syntax

=RANDRAYLEIGH(sigma)

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.

Parameter and source contract

The required sigma is the Rayleigh scale, not the output standard deviation. Negative sigma leads to #NUM!. The helper rejects a zero unit driver U and computes sigma*SQRT(-2*LN(U)) for an accepted driver.

For positive scale, the ideal mean is sigmaSQRT(PI()/2), variance is sigma²(2-PI()/2), and median is sigmaSQRT(2LN(2)). These quantities are different from sigma. A scale 0 result is 0 after an accepted finite transform, but the helper has no early-return zero-scale branch.

Complete worksheet setup

Create RayleighControls. Put scale 3 in B2 and enter =RANDRAYLEIGH($B$2) in D2. D2 changes with the random generator and has no fixed expected value.

In F2 enter =$B$2*SQRT(PI()/2) for the ideal mean, approximately 3.75994241195. In F3 enter =$B$2*SQRT(2*LN(2)) for the ideal median, approximately 3.53223006755. The function’s parameter 3 is neither of these output summaries.

Deterministic transformation controls

Put 0.25,0.5 and 0.75 in A7:A9. In B7 enter =$B$2*SQRT(-2*LN(A7)) and fill through B9. The independent results are:

Supplied control inputs Independent reference result
U=.25 4.995327666946
U=.5 3.532230067546
U=.75 2.275582849323

These are supplied drivers, not samples from RANDRAYLEIGH. Do not include 0 in the literal formula as if it replicated the source’s retry operation. For the inverse lower-tail CDF, substitute 1-p for U rather than using p unchanged.

Advanced: calculate a magnitude threshold

For nonnegative t, the ideal survival probability is EXP(-(t^2)/(2*sigma^2)). With scale 3 and threshold 6, =EXP(-(6^2)/(2*$B$2^2)) is approximately 0.135335283237. The central nonnegative interval 0 through 6 therefore has probability approximately 0.864664716763.

The ideal second moment is 2*sigma², which is 18 here. The root-mean-square magnitude is =SQRT(2)*B2, approximately 4.24264068712. RMS magnitude is not the mean or standard deviation, so label each statistic explicitly.

Advanced: explain the two-component model

The ideal magnitude SQRT(X²+Y²) is Rayleigh with scale sigma when X and Y are independent, zero-mean normal variables with standard deviation sigma. As a deterministic geometry control, inputs 3 and 4 give magnitude 5; this is not a generated observation or a test of independence.

Nonzero component means lead to a different model, and unequal component variances do not satisfy the stated equal-scale assumption. A Rayleigh formula should not be substituted merely because a quantity is nonnegative.

Advanced: transform to an exponential quantity

For an ideal Rayleigh variate R, the normalized square R²/(2*sigma²) is exponential with scale 1. In the supplied-driver worksheet, use =B7^2/(2*$B$2^2); the result is exactly the mathematical expression -LN(A7), apart from floating-point rounding.

For U=0.5 the reference normalized square is 0.69314718056. This identity is a useful arithmetic cross-check without drawing any random numbers. It also explains why the second moment is 2*sigma².

Scale changes and boundaries

Doubling sigma to 6 doubles the same-driver transformation and multiplies variance by 4. The ideal mean becomes approximately 7.51988482389. To demonstrate same-draw scaling, multiply one already calculated random cell by 2; a second RANDRAYLEIGH call is a separate generator call.

=RANDRAYLEIGH(-3) gives #NUM!. =RANDRAYLEIGH(0) gives 0 for accepted finite drivers but can still consume generator state. Positive-scale mathematical support does not certify every machine endpoint under extreme rounding or underflow. No tail-quality or native execution test was performed.

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.