| circ_cor {BAMBI} | R Documentation |
Sample circular correlation coefficients
Description
Sample circular correlation coefficients
Usage
circ_cor(
x,
type = "js",
alternative = "two.sided",
jackknife = FALSE,
bootse = FALSE,
n.boot = 100
)
Arguments
x |
two column matrix. NA values are not allowed. |
type |
type of the circular correlation. Must be one of "fl", "js", "tau1" and "tau2". See details. |
alternative |
one of |
jackknife |
logical. Compute jackknifed estimate and standard error? Defaults to FALSE. |
bootse |
logical. Compute bootstrap standard error? Defaults to FALSE. |
n.boot |
number of bootstrapped samples to compute bootstrap standard error. Defaults to
100. Ignored if |
Details
circ_cor calculates the (sample) circular correlation between the columns of x.
Two parametric (the Jammalamadaka-Sarma (1988, equation 2.6) form "js", and
the Fisher-Lee (1983, Section 3) form "fl")
and two non-parametric (two versions of Kendall's tau) correlation coefficients are considered.
The first version of Kendall's tau ("tau1") is based on equation 2.1 in Fisher and Lee (1982),
whereas the second version ("tau2") is computed using equations 6.7-6.8 in Zhan et al (2017).
The cost-complexity for "js", "fl", "tau2" and "tau1" are O(n), O(n^2), O(n^2) and O(n^3)
respectively, where n denotes the number of rows in x. As such, for large n evaluation of
"tau1" will be slow.
References
Fisher, N. I. and Lee, A. J. (1982). Nonparametric measures of angular-angular association. Biometrika, 69(2), 315-321.
Fisher, N. I. and Lee, A. J. (1983). A correlation coefficient for circular data. Biometrika, 70(2):327-332.
Jammalamadaka, S. R. and Sarma, Y. (1988). A correlation coefficient for angular variables. Statistical theory and data analysis II, pages 349-364.
Zhan, X., Ma, T., Liu, S., & Shimizu, K. (2017). On circular correlation for data on the torus. Statistical Papers, 1-21.
Examples
# generate data from vmsin model
set.seed(1)
dat <- rvmsin(100, 2,3,-0.8,0,0)
# now calculate circular correlation(s) between the 2 columns of dat
circ_cor(dat, type="js")
circ_cor(dat, type="fl")
circ_cor(dat, type="tau1")
circ_cor(dat, type="tau2")