Learn R Programming

cylcop (version 0.2.0)

cyl_rect_combine: 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
)

Value

An R object of class 'cyl_rect_combine'.

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.

References

Durante2009cylcop

Hodelapplcylcop

Hodelmethodcylcop

Examples

Run this code

#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)
}

Run the code above in your browser using DataLab