Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

setTheta

Specify the Parameter(s) of a Copula


Description

Set or change the parameter theta (theta) of a copula. The name ‘theta’ has been from its use in (nested) Archimedean copulas, where x is of class "acopula" or "outer_nacopula". This is used for constructing copula models with specified parameter, as, for example, in onacopula(), or also gofCopula.

Usage

setTheta(x, value, na.ok = TRUE, noCheck = FALSE, freeOnly = TRUE, ...)

## S4 method for signature 'acopula,ANY'
setTheta(x, value, na.ok = TRUE, noCheck = FALSE, freeOnly = TRUE, ...)
## S4 method for signature 'copula,ANY'
setTheta(x, value, na.ok = TRUE, noCheck = FALSE, freeOnly = TRUE, ...)
## S4 method for signature 'xcopula,ANY'
setTheta(x, value, na.ok = TRUE, noCheck = FALSE, freeOnly = TRUE, ...)
## S4 method for signature 'outer_nacopula,numeric'
setTheta(x, value, na.ok = TRUE, noCheck = FALSE, freeOnly = TRUE, ...)
## S4 method for signature 'khoudrajiCopula,ANY'
setTheta(x, value, na.ok = TRUE, noCheck = FALSE, freeOnly = TRUE, ...)

## S4 method for signature 'mixCopula,ANY'
setTheta(x, value, na.ok = TRUE, noCheck = FALSE, freeOnly = TRUE,
         treat.negative = c("set.0", "warn.set0", "stop"), ...)

Arguments

x

an R object of class Copula, i.e., any copula from package copula.

value

parameter value or vector, numeric or NA (when na.ok is true), corresponding to the “free” parameters.

...

further arguments for methods.

na.ok

logical indicating if NA values are ok for theta.

noCheck

logical indicating if parameter constraint checks should be skipped.

freeOnly

logical indicating that only non-fixed aka “free” parameters are to be set. If true as by default, setTheta() modifies only the free parameters of the copula; see also fixParam.

treat.negative

a character string indicating how negative mixture weights should be handled. If not "stop" which produces an error via stop, negative mixture weights are replaced by zero.

Value

an R object of the same class as x, with the main parameter (vector) (often called theta) set to value.

See Also

the “inverse” function, a “getter” method, is getTheta().

Examples

myC <- setTheta(copClayton, 0.5)
myC
## Frank copula with Kendall's tau = 0.8 :
(myF.8 <- setTheta(copFrank, iTau(copFrank, tau = 0.8)))

# negative theta is ok for dim = 2 :
myF <- setTheta(copFrank, -2.5, noCheck=TRUE)
myF@tau(myF@theta) # -0.262

myT <- setTheta(tCopula(df.fixed=TRUE), 0.7)
stopifnot(all.equal(myT, tCopula(0.7, df.fixed=TRUE),
                    check.environment=FALSE, tolerance=0))

(myT2 <- setTheta(tCopula(dim=3, df.fixed=TRUE), 0.7))
## Setting 'rho' and 'df'  --- for default df.fixed=FALSE :
(myT3 <- setTheta(tCopula(dim=3), c(0.7, 4)))

copula

Multivariate Dependence with Copulas

v1.0-1
GPL (>= 3) | file LICENCE
Authors
Marius Hofert [aut] (<https://orcid.org/0000-0001-8009-4665>), Ivan Kojadinovic [aut] (<https://orcid.org/0000-0002-2903-1543>), Martin Maechler [aut, cre] (<https://orcid.org/0000-0002-8685-9910>), Jun Yan [aut] (<https://orcid.org/0000-0003-4401-7296>), Johanna G. Nešlehová [ctb] (evTestK(), <https://orcid.org/0000-0001-9634-4796>), Rebecca Morger [ctb] (fitCopula.ml(): code for free mixCopula weight parameters)
Initial release
2020-12-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.