Learn R Programming

cylcop (version 0.2.0)

set_cop_param: Change Attributes of 'cyl_copula' Objects

Description

These methods can be used, e.g. in other functions, to give users limited access to the parameters of a copula.

Usage

set_cop_param(copula, param_val, param_name, ...)

# S4 method for cyl_cubsec set_cop_param(copula, param_val, param_name)

# S4 method for cyl_quadsec set_cop_param(copula, param_val, param_name)

# S4 method for cyl_rect_combine set_cop_param(copula, param_val, param_name)

# S4 method for cyl_rot_combine set_cop_param(copula, param_val, param_name)

# S4 method for cyl_vonmises set_cop_param(copula, param_val, param_name)

Value

A 'cyl_copula' object with the changed parameters.

Arguments

copula

R object of class 'cyl_copula'.

param_val

numeric vector holding the values to which the parameters given in copula@parameters should be changed.

param_name

vector of character strings holding the names of the parameters to be changed.

...

additional arguments.

Details

Note that for a rectangular patchwork copula ('cyl_rect_combine') the attribute rectangles_symmetric cannot be changed by set_cop_param(), since rectangular patchwork copulas with symmetric rectangles are treated as distinct from rectangular patchwork copulas with potentially asymmetric rectangles. Therefore, when changing one of the bounds of the lower rectangle of such a copula, the corresponding bound of the upper rectangle is automatically changed as well (see examples).

Examples

Run this code
cop <- cyl_rect_combine(copula::normalCopula(0.2),low_rect = c(0.1,0.4), up_rect="symmetric")
cop
cop <- set_cop_param(cop, param_val = c(0.1, 0.3), param_name = c("rho.1", "low_rect2"))
cop <- cyl_rect_combine(copula::normalCopula(0.2),low_rect = c(0.1,0.4), up_rect=c(0.6,0.9))
cop
cop <- set_cop_param(cop, param_val = 0.3, param_name = "low_rect2")
cop

Run the code above in your browser using DataLab