Statistics & probability

Rayleigh circular uniformity test calculator with prespecified direction option

Test circular uniformity with Rayleigh or a prespecified directional V statistic and seeded null simulations.

Your numbers

Valid JSON.
Valid JSON; preserve the shown array or object structure.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

The Rayleigh statistic measures whether unit vectors associated with observed angles have a nonzero resultant. It is particularly responsive to a single concentrated direction rather than every possible departure from uniformity.

THE FORMULAConvertanglesradians;C=Σcosθ,S=Σsinθ,R=hypot(C,S),r=R/n,Z=R²/n. Rayleighlarge-np approxexp(-Z)*[1+(2Z-Z²)/(4n)-(24Z-132Z²+76Z³-9Z⁴)/(288n²)]bounded[0,1],labelasymptotic finitecorrectionnotexact. Forprespecifieddirectionmu0 V=Ccosmu0+Ssinmu0, standardizedu=V*sqrt(2/n),one-sided p=1-Phi(u). No choosingmu0fromsampleangle. UseMC/exact reference forsmalln ratherthanfakeexactp.

A worked example

With the prefilled inputs, rayleighZ = 2.6038572848115427e-32.

Good to know

Independent circular observations; V alternative direction must be selected before observing data. Rayleigh has poor power for symmetric multimodal alternatives.

Test a circular uniform reference

The Rayleigh statistic measures whether unit vectors associated with observed angles have a nonzero resultant. It is particularly responsive to a single concentrated direction rather than every possible departure from uniformity.

A balanced two-mode pattern can cancel its vectors and produce a small statistic despite clear nonuniformity. The test result therefore needs to be interpreted with the actual angular pattern.

Rayleigh zero-resultant exampleFour balanced directions have no resultant0°90°180°270°Σ cosθ = 0Σ sinθ = 0R = 0; Z = 0Mean direction undefinedBalanced vector cancellation is not a guarantee of uniformity.
Scroll across to see the full diagram.
Directions0,90,180,270degrees cancel exactly. Their Rayleigh statistic is zero and the vector mean direction is undefined. Repeating the balanced set gives a supported larger analytic example.

Compare with the Von Mises distribution fit calculator from angle observations. Test circular uniformity with resultant or prespecified-direction score; fitting a von Mises distribution does not test a uniform sampling null.

Choose angle and orientation conventions

Use the prefilled input structure and preserve the declared column or index order. Enter degrees or radians explicitly, with a consistent zero direction and sense of rotation. Adding a full turn to an observation leaves its vector unchanged.

Axial measurements treat an axis and its opposite as equivalent. They require an explicit doubled-angle transformation; ordinary directional data should not be doubled simply to obtain a stronger result. Angles can be supplied in degrees or radians, selected explicitly. The sine and cosine sums define the resultant vector; its length is divided by sample size for the mean resultant length. A numerically zero resultant has no meaningful mean direction, and the interface marks that direction undefined rather than returning an arbitrary angle from rounding noise. Adding a complete revolution to an observation does not change its contribution. Data recorded on an axial rather than directional scale may need a justified doubled-angle analysis before using this model.

Sum the unit vectors

Each observation contributes cosine and sine components. Their sums define the resultant length R, and dividing by the sample count gives the mean resultant length between zero and one.

When the resultant is zero, the sample has no defined mean direction under this vector summary. Displaying an arbitrary angle of zero would confuse absence of a resultant with evidence for the zero direction.

Use the Rayleigh reference carefully

The working statistic is R-squared divided by the number of observations. The displayed analytic p-value uses an asymptotic reference with finite-sample correction, rather than a claim of an exact small-sample calculation.

For very small samples, assess an exact or simulation-based reference using an appropriate procedure. A correction term alone does not make every sample size or concentration regime equally reliable.

Four balanced directions

Angles zero,ninety,one-hundred-eighty and two-hundred-seventy degrees have cancelling sine and cosine components. Their resultant and Rayleigh statistic are zero, with the analytic upper-tail reference equal to one.

For a direction specified in advance as zero degrees, the V projection is also zero. Its standardized value is zero and the one-sided normal reference is one-half, which answers a different directional question.

Reserve the V test for a prior direction

The V statistic projects the resultant onto a direction chosen before inspecting the observations. Its alternative favors clustering toward that particular direction rather than toward whichever direction the sample selects.

Choosing the direction from the sample and then using the prespecified-direction reference reuses the data. The apparent gain in significance would no longer have the stated interpretation. Axial measurements identify an unoriented line rather than a directed arrow.

Inspect circular structure alongside p-values

Plot angles or a circular histogram to see multimodality, outliers and possible axial structure. A vector-based statistic is a concise summary that can miss patterns visible in the distribution.

A small p-value indicates incompatibility with the specified uniform reference under the test's assumptions. It does not measure concentration size, practical importance or certainty about a physical preferred direction. The page always reports the Rayleigh statistic and its stated finite-sample p-value approximation. When a direction is supplied in advance, the selected Monte Carlo comparison instead uses the directional V statistic; with null direction it uses the Rayleigh statistic. Simulated angles are uniform over a full revolution, the number of replicates is explicit and the p-value uses a plus-one correction. This simulation checks a specified uniform null, not an arbitrary multimodal alternative. Choosing a preferred direction after seeing the data invalidates the usual one-sided V interpretation and should not be hidden by entering the observed mean direction. Independent circular observations; V alternative direction must be selected before observing data. Rayleigh has poor power for symmetric multimodal alternatives.

A few questions, answered

Does adding360degrees change the answer?

No. A full-turn shift leaves the sine and cosine components unchanged.

Why is the mean direction missing?

When the resultant is effectively zero, there is no defined vector mean direction.

Can I choose the V-test direction from the sample mean?

No. Its stated one-sided reference requires a direction chosen independently in advance.

Can a clearly nonuniform sample have a small Rayleigh statistic?

Yes. Balanced multimodal patterns can cancel the first trigonometric moment.

Find your calculator

Start typing to explore the library.