Learn R Programming

CircMLE (version 0.3.0)

dcor.circular: circular distance correlation function

Description

Perform a distance correlation between circular datasets or between circular and linear datasets.

Usage

dcor.circular(x, y, method = "chord", type = "c-c", ...)

Arguments

x

A vector of class 'circular', or numeric vector of angles measured in radians

y

A vector of class 'circular', numeric vector of angles measured in radians, or numeric vector

method

the distance measure to be used. This must be one of the following functions: <U+2018>"angularseparation"<U+2019>, <U+2018>"chord"<U+2019>, '"geodesic"<U+2019>, or '"circ.range"' (default = "chord"). see ?dist.circular for additional details.

type

if <U+2018>type == "c-c"<U+2019> then perform a circular-circular distance corellation, else if <U+2018>type == "c-l"<U+2019> then perform a circular-linear distance corellation (default = "c-c").

...

additional parameters passed to the dcor.test function

Value

Same as from the dcor.test function: a list with class <U+2018>htest<U+2019>containing

method: description of test

statistic: observed value of the test statistic

estimate: dCov(x,y) or dCor(x,y)

estimates: a vector: [dCov(x,y), dCor(x,y), dVar(x), dVar(y)]

replicates: replicates of the test statistic

p.value: approximate p-value of the test

n: sample size

data.name: description of data

See Also

dcor dcov DCOR dcor.test dist.circular

Examples

Run this code
# NOT RUN {
# Circular-circular distance corellation
x <- circular::rvonmises(n = 50, mu = circular::circular(0), kappa = 3)
y <- x + circular::rvonmises(n = 50, mu = circular::circular(pi), kappa = 10)
dcor.circular(x, y)

# Run permutation test with 9999 iterations
dcor.circular(x, y, R = 9999)

# Circular-linear distance corellation
x <- circular::rvonmises(n = 50, mu = circular::circular(0), kappa = 3)
y <- as.numeric(x) + rnorm(50, mean = 5, sd = 2)
dcor.circular(x, y, type = "c-l", R = 9999)
# }

Run the code above in your browser using DataLab