biv_lrt {ridgetorus}R Documentation

Tests of homogeneity and independence in bivariate sine von Mises and wrapped Cauchy distributions

Description

Performs the following likelihood ratio tests for the concentrations in bivariate sine von Mises and wrapped Cauchy distributions: (1) homogeneity: H_0:\kappa_1=\kappa_2 vs. H_1:\kappa_1\neq\kappa_2, and H_0:\xi_1=\xi_2 vs. H_1:\xi_1\neq\xi_2, respectively; (2) independence: H_0:\lambda=0 vs. H_1:\lambda\neq0, and H_0:\rho=0 vs. H_1:\rho\neq0. The tests (1) and (2) can be performed simultaneously.

Usage

biv_lrt(x, hom = FALSE, indep = FALSE, fit_mle = NULL, type, ...)

Arguments

x

matrix of dimension c(n, 2) containing the n observations of the pair of angles.

hom

test the homogeneity hypothesis? Defaults to FALSE.

indep

test the independence hypothesis? Defaults to FALSE.

fit_mle

output of fit_bvm_mle or fit_bwc_mle with hom = FALSE. Computed internally if not provided.

type

either "bvm" (bivariate sine von Mises) or "bwc" (bivariate wrapped Cauchy).

...

optional parameters passed to fit_bvm_mle and fit_bwc_mle, such as start, lower, or upper.

Value

A list with class htest:

statistic

the value of the likelihood ratio test statistic.

p.value

the p-value of the test (computed using the asymptotic distribution).

alternative

a character string describing the alternative hypothesis.

method

description of the type of test performed.

df

degrees of freedom.

data.name

a character string giving the name of theta.

fit_mle

maximum likelihood fit.

fit_null

maximum likelihood fit under the null hypothesis.

References

Kato, S. and Pewsey, A. (2015). A Möbius transformation-induced distribution on the torus. Biometrika, 102(2):359–370. doi:10.1093/biomet/asv003

Singh, H., Hnizdo, V., and Demchuk, E. (2002). Probabilistic model for two dependent circular variables. Biometrika, 89(3):719–723. doi:10.1093/biomet/89.3.719

Examples

## Bivariate sine von Mises

# Homogeneity
n <- 200
mu <- c(0, 0)
kappa_0 <- c(1, 1, 0.5)
kappa_1 <- c(0.7, 0.1, 0.25)
samp_0 <- r_bvm(n = n, mu = mu, kappa = kappa_0)
samp_1 <- r_bvm(n = n, mu = mu, kappa = kappa_1)
biv_lrt(x = samp_0, hom = TRUE, type = "bvm")
biv_lrt(x = samp_1, hom = TRUE, type = "bvm")

# Independence
kappa_0 <- c(0, 1, 0)
kappa_1 <- c(1, 0, 1)
samp_0 <- r_bvm(n = n, mu = mu, kappa = kappa_0)
samp_1 <- r_bvm(n = n, mu = mu, kappa = kappa_1)
biv_lrt(x = samp_0, indep = TRUE, type = "bvm")
biv_lrt(x = samp_1, indep = TRUE, type = "bvm")

# Independence and homogeneity
kappa_0 <- c(3, 3, 0)
kappa_1 <- c(3, 1, 0)
samp_0 <- r_bvm(n = n, mu = mu, kappa = kappa_0)
samp_1 <- r_bvm(n = n, mu = mu, kappa = kappa_1)
biv_lrt(x = samp_0, indep = TRUE, hom = TRUE, type = "bvm")
biv_lrt(x = samp_1, indep = TRUE, hom = TRUE, type = "bvm")

## Bivariate wrapped Cauchy

# Homogeneity
xi_0 <- c(0.5, 0.5, 0.25)
xi_1 <- c(0.7, 0.1, 0.5)
samp_0 <- r_bwc(n = n, mu = mu, xi = xi_0)
samp_1 <- r_bwc(n = n, mu = mu, xi = xi_1)
biv_lrt(x = samp_0, hom = TRUE, type = "bwc")
biv_lrt(x = samp_1, hom = TRUE, type = "bwc")

# Independence
xi_0 <- c(0.1, 0.5, 0)
xi_1 <- c(0.3, 0.5, 0.2)
samp_0 <- r_bwc(n = n, mu = mu, xi = xi_0)
samp_1 <- r_bwc(n = n, mu = mu, xi = xi_1)
biv_lrt(x = samp_0, indep = TRUE, type = "bwc")
biv_lrt(x = samp_1, indep = TRUE, type = "bwc")

# Independence and homogeneity
xi_0 <- c(0.2, 0.2, 0)
xi_1 <- c(0.1, 0.2, 0.1)
samp_0 <- r_bwc(n = n, mu = mu, xi = xi_0)
samp_1 <- r_bwc(n = n, mu = mu, xi = xi_1)
biv_lrt(x = samp_0, indep = TRUE, hom = TRUE, type = "bwc")
biv_lrt(x = samp_1, indep = TRUE, hom = TRUE, type = "bwc")

[Package ridgetorus version 1.0.2 Index]