cyl_rect_combine {cylcop}R Documentation

Construction of 'cyl_rect_combine' Objects

Description

Constructs a circular-linear copula of class 'cyl_rect_combine' from a rectangular patchwork of copulas.

Usage

cyl_rect_combine(
  copula,
  background = indepCopula(),
  low_rect = c(0, 0.5),
  up_rect = "symmetric",
  flip_up = TRUE
)

Arguments

copula

'Copula' object of the package 'copula' or 'cyl_vonmises' object, the copula in the rectangles.

background

'cyl_copula' or 'Copula' object of the package 'copula', the copula where no rectangles overlay the unit square. If this copula is not symmetric, the overall cyl_rect_combine-copula will also not be symmetric.

low_rect

numeric vector of length 2 containing the lower and upper edge (u-value) of the lower rectangle.

up_rect

numeric vector of length 2 containing the lower and upper edge (u-value) of the upper rectangle, or the character string "symmetric" if it should be the mirror image (with respect to u=0.5) of the lower rectangle.

flip_up

logical value indicating whether the copula (copula) is rotated 90 degrees in the upper (flip_up = TRUE) or lower rectangle.

Value

An R object of class 'cyl_rect_combine'.

References

Durante F, Saminger-Platz S, Sarkoci P (2009). “Rectangular patchwork for bivariate copulas and tail dependence.” Communications in Statistics - Theory and Methods, 38(15), 2515–2527. ISSN 03610926, doi:10.1080/03610920802571203.

Hodel FH, Fieberg JR (2022). “Circular-Linear Copulae for Animal Movement Data.” Methods in Ecology and Evolution. doi:10.1111/2041-210X.13821.

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/.

Examples


#symmetric rectangles spanning entire unit square
cop <- cyl_rect_combine(copula::frankCopula(2))
if(interactive()){
 plot_cop_surf(copula = cop, type = "pdf", plot_type = "ggplot", resolution = 20)
}

#symmetric rectangles, independence copula as background
cop <- cyl_rect_combine(copula::frankCopula(2),
  low_rect = c(0, 0.3),
  up_rect = "symmetric",
  flip_up = FALSE
)
if(interactive()){
 plot_cop_surf(copula = cop, type = "pdf", plot_type = "ggplot", resolution = 20)
}

#symmetric rectangles, cy_quadsec-copula as background
cop <- cyl_rect_combine(copula::normalCopula(0.3),
  low_rect = c(0.1, 0.4),
  up_rect = "symmetric",
  background = cyl_quadsec(-0.1)
)
if(interactive()){
 plot_cop_surf(copula = cop, type = "pdf", plot_type = "ggplot", resolution = 20)
}

#asymmetric rectangles, von Mises copula as background.
#!!Not a symmetric circular linear copula!!
cop <- cyl_rect_combine(copula::normalCopula(0.3),
  low_rect = c(0.1, 0.4),
  up_rect = c(0.5, 0.7),
  background = cyl_vonmises(mu = pi, kappa = 0.3)
)
if(interactive()){
 plot_cop_surf(copula = cop, type = "pdf", plot_type = "ggplot", resolution = 20)
}


[Package cylcop version 0.2.0 Index]