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

fixedPar

Fix a Subset of a Copula Parameter Vector


Description

It is sometimes useful to keep fixed some components of a copula parameter vector whereas the others are “free” and will be estimated, e.g., by fitCopula.

The first two functions set or modify the “fixedness”, whereas isFree(), isFreeP() and nParam() are utilities enquiring about the “fixedness” of the parameters (of a copula).

Usage

fixParam(param, fixed = TRUE)
fixedParam(copula) <- value

isFreeP(param)
## S4 method for signature 'copula'
isFree(copula)
## and specific '*Copula' methods
## S4 method for signature 'copula'
nParam(copula, freeOnly = FALSE)
## and specific '*Copula' methods

Arguments

param

numeric parameter vector

fixed, value

logical vector of the same length as param indicating for each component param[j] if it is (going to be) fixed or not.

copula

a "copula" object.

freeOnly

logical (scalar) indicating if only free parameters should be counted or all.

Value

fixParam(param) returns a numeric vector with attribute "fixed"(a logical, either TRUE or vector of the same length as param) to indicate which components of param are to be held fixed or not.

fixedParam<-, a generic function, returns a "copula" object with a partly fixed parameter (slot), i.e., corresponding to fixParam() above.

See Also

fitCopula for fitting; t-copulas, tCopula(*, df.fixed=TRUE) now uses parameter fixing for "df".

setTheta() for setting or changing the non-fixed parameter values.

Examples

nc1 <- normalCopula(dim = 3, fixParam(c(.6,.3,.2), c(TRUE, FALSE,FALSE)),
                    dispstr = "un")
nc1
nc13 <- nc12 <- nc1
fixedParam(nc12) <- c(TRUE, TRUE, FALSE) ; nc12
fixedParam(nc13) <- c(TRUE, FALSE, TRUE) ; nc13
set.seed(17); x <- rCopula(100, nc1)
summary(f.13 <- fitCopula(nc13, x, method = "ml"))
f.13@copula  # 'rho.2' is estimated; the others kept fixed

## Setting to 'FALSE' (removes the "fixed" parts completely):
nc0 <- nc13; fixedParam(nc0) <- FALSE
nc0
stopifnot(is.null(attributes(nc0@parameters)))

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.