cor_cyl {cylcop} | R Documentation |
Estimate a Rank-Based Circular-Linear Correlation Coefficient
Description
The code is based on Mardia (1976), Solow et al. (1988) and Tu (2015). The function returns a numeric value between 0 and 1, not -1 and 1, positive and negative correlation cannot be discerned. Note also that the correlation coefficient is independent of the marginal distributions.
Usage
cor_cyl(theta, x)
Arguments
theta |
numeric vector of angles (measurements of a circular variable). |
x |
numeric vector of step lengths (measurements of a linear variable). |
Value
A numeric value between 0 and 1, the circular-linear correlation coefficient.
References
Mardia KV (1976). “Linear-Circular Correlation Coefficients and Rhythmometry.” Biometrika, 63(2), 403–405. ISSN 00063444, doi:10.2307/2335637.
Solow AR, Bullister JL, Nevison C (1988). “An application of circular-linear correlation analysis to the relationship between Freon concentration and wind direction in Woods Hole, Massachusetts.” Environmental Monitoring and Assessment, 10(3), 219–228. ISSN 1573-2959, doi:10.1007/BF00395081, https://doi.org/10.1007/BF00395081.
Tu R (2015). “A Study of the Parametric and Nonparametric Linear-Circular Correlation Coefficient.” California Polytechnic State University, San Luis Obispo, 1–24. https://digitalcommons.calpoly.edu/statsp/51/.
Hodel FH, Fieberg JR (2021). “Cylcop: An R Package for Circular-Linear Copulae with Angular Symmetry.” bioRxiv. doi:10.1101/2021.07.14.452253, https://www.biorxiv.org/content/10.1101/2021.07.14.452253v3/.
See Also
mi_cyl()
, fit_cylcop_cor()
.
Examples
set.seed(123)
cop <- cyl_quadsec(0.1)
#draw samples and calculate the correlation coefficient
sample <- rcylcop(100, cop)
cor_cyl(theta = sample[,1], x = sample[,2])
#the correlation coefficient is independent of the marginal distribution.
sample <- traj_sim(100,
cop,
marginal_circ = list(name = "vonmises", coef = list(0, 1)),
marginal_lin = list(name = "weibull", coef = list(shape = 2))
)
cor_cyl(theta = sample$angle, x = sample$steplength)
cor_cyl(theta = sample$cop_u, x = sample$cop_v)
# Estimate correlation of samples drawn from circular-linear copulas with
# perfect correlation
cop <- cyl_rect_combine(copula::normalCopula(1))
sample <- rcylcop(100, cop)
cor_cyl(theta = sample[,1], x = sample[,2])