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])
Run the code above in your browser using DataLab