weighted_rayleigh: Weighted Goodness-of-fit Test for Circular Data

View source: R/stat_tests.R

weighted_rayleighR Documentation

Weighted Goodness-of-fit Test for Circular Data

Description

Weighted version of the Rayleigh test (or V0-test) for uniformity against a distribution with a priori expected von Mises concentration.

Usage

weighted_rayleigh(x, mu = NULL, w = NULL, axial = TRUE, quiet = FALSE)

Arguments

x

numeric vector. Values in degrees

mu

The a priori expected direction (in degrees) for the alternative hypothesis.

w

numeric vector weights of length length(x). If NULL, the non-weighted Rayleigh test is performed.

axial

logical. Whether the data are axial, i.e. \pi-periodical (TRUE, the default) or directional, i.e. 2 \pi-periodical (FALSE).

quiet

logical. Prints the test's decision.

Details

The Null hypothesis is uniformity (randomness). The alternative is a distribution with a (specified) mean direction (mu). If statistic >= p.value, the null hypothesis of randomness is rejected and angles derive from a distribution with a (or the specified) mean direction.

Value

a list with the components:

R or C

mean resultant length or the dispersion (if mu is specified). Small values of R (large values of C) will reject uniformity. Negative values of C indicate that vectors point in opposite directions (also lead to rejection).

statistic

Test statistic

p.value

significance level of the test statistic

See Also

rayleigh_test()

Examples

# Load data
data("cpm_models")
data(san_andreas)
PoR <- equivalent_rotation(subset(cpm_models, model == "NNR-MORVEL56"), "na", "pa")
sa.por <- PoR_shmax(san_andreas, PoR, "right")
data("iceland")
PoR.ice <- equivalent_rotation(subset(cpm_models, model == "NNR-MORVEL56"), "eu", "na")
ice.por <- PoR_shmax(iceland, PoR.ice, "out")
data("tibet")
PoR.tib <- equivalent_rotation(subset(cpm_models, model == "NNR-MORVEL56"), "eu", "in")
tibet.por <- PoR_shmax(tibet, PoR.tib, "in")

# GOF test:
weighted_rayleigh(tibet.por$azi.PoR, mu = 90, w = 1 / tibet$unc)
weighted_rayleigh(ice.por$azi.PoR, mu = 0, w = 1 / iceland$unc)
weighted_rayleigh(sa.por$azi.PoR, mu = 135, w = 1 / san_andreas$unc)

tectonicr documentation built on Sept. 11, 2024, 6:05 p.m.