| cor_cyl | R Documentation |
The code is based on \insertCiteMardia1976;textualcylcop, \insertCiteSolow1988;textualcylcop and \insertCiteTu2015;textualcylcop. 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.
cor_cyl(theta, x)
theta |
numeric vector of angles (measurements of a circular variable). |
x |
numeric vector of step lengths (measurements of a linear variable). |
A numeric value between 0 and 1, the circular-linear correlation coefficient.
Mardia1976cylcop
\insertRefSolow1988cylcop
\insertRefTu2015cylcop
\insertRefHodelmethodcylcop
mi_cyl(), fit_cylcop_cor().
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])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.