Copula cumulative distribution function ('p'), probability density function ('d'), conditional probability cdf (c), quantile (q), random vector sampling ('r'), parameters estimation ('e'), goodness-of-fit test ('g'), checking copula properties ('is').
pCopula(data, generator=genGumbel(), depfun=dep1(), copula=NULL,
gpars=generator$parameters, dpars=depfun$parameters,
pars=if(is.null(copula)) list(gpars,dpars) else copula$parameters,
subdivisions=50, quantile=NULL,probability=data[,quantile])
pCopulaEmpirical(data, base = data)dCopula(data,generator=genGumbel(),depfun=dep1(),copula=NULL,
gpars=generator$parameters, dpars=depfun$parameters,
pars=if(is.null(copula)) list(gpars,dpars) else copula$parameters,
difference=1e-4,area=c(0), shrinkdiff=FALSE)
cCopula(data, conditional.on=c(1), generator=genGumbel(), depfun=dep1(), copula=NULL,
gpars=generator$parameters, dpars=depfun$parameters,
pars=if(is.null(copula)) list(gpars,dpars) else copula$parameters,
difference=1e-4,area=c(0), quantile=NULL, probability=data[,quantile])
qCopula(data, quantile=1, probability=0.95, conditional.on=NULL,
generator=genGumbel(), depfun=dep1(), copula=NULL,
gpars=generator$parameters, dpars=depfun$parameters,
pars=if(is.null(copula)) list(gpars,dpars) else copula$parameters,
difference=1e-4, area=c(0))
rCopula(n, dim=2, generator=genGumbel(), depfun=dep1(), copula=NULL,
gpars=generator$parameters, dpars=depfun$parameters,
pars=if(is.null(copula)) list(gpars,dpars) else copula$parameters)
rCopulaArchimax2D(n, generator=genLog(), depfun=dep1(),
gpars=generator$parameters, dpars=depfun$parameters, pars=list(gpars,dpars))
eCopula(data, generator=genGumbel(), depfun=dep1(), copula=NULL,
glimits=list(generator$lower,generator$upper), dlimits=list(depfun$lower,depfun$upper),
limits=list(copula$lower,copula$upper),
ggridparameters=if(!is.null(unlist(glimits))) do.call(
function(...) mapply(c,...,length.out=pgrid,SIMPLIFY=FALSE), glimits) else NULL,
dgridparameters=if(!is.null(unlist(dlimits))) do.call(
function(...) mapply(c,...,length.out=pgrid,SIMPLIFY=FALSE), dlimits) else NULL,
gridparameters=if(!is.null(unlist(limits))) do.call(function(...)
mapply(c,...,length.out=pgrid,SIMPLIFY=FALSE), limits) else NULL,
technique=c("ML","LS","icorr"), procedure=c("optim","nlminb","nls","grid"),
method="default", corrtype = c("kendall","spearman"), control=NULL, pgrid=10)
gCopula(data, generator, depfun=dep1(), copula=NULL,
glimits=list(generator$lower,generator$upper),
dlimits=list(depfun$lower,depfun$upper),
limits=list(copula$lower,copula$upper),
etechnique=c("ML","LS","icorr"), eprocedure=c("optim","nlminb","nls"),
emethod="default", ecorrtype=c("kendall","spearman"), econtrol=NULL,
N=100, m=nrow(data), ncores=1)
gCopulaEmpirical(data,N=100,ncores=1)
isCopula(generator=genLog(),depfun=dep1(), copula=NULL,
glimits=list(generator$lower,generator$upper),
dlimits=list(depfun$lower,depfun$upper),
limits=list(copula$lower,copula$upper),
ggridparameters=if(!is.null(unlist(glimits))) do.call(
function(...) mapply(c,...,length.out=pgrid,SIMPLIFY=FALSE), glimits) else NULL,
dgridparameters=if(!is.null(unlist(dlimits))) do.call(
function(...) mapply(c,...,length.out=pgrid,SIMPLIFY=FALSE), dlimits) else NULL,
gridparameters=if(!is.null(unlist(limits))) do.call(
function(...) mapply(c,...,length.out=pgrid,SIMPLIFY=FALSE), limits) else NULL,
dagrid=10, pgrid=10, dim=3, tolerance=1e-15)
# S3 method for eCopulaArchimax
print(x,...)
# S3 method for eCopulaGeneric
print(x,...)
# S3 method for gCopula
print(x,...)
# S3 method for isCopula
print(x,...)
Numeric vector, in case of p
,d
,c
and qCopula
.
Matrix from rCopula
.
eCopula
returns list containing
list of numeric vectors. Generator, depfu or generic copula parameters.
character vector of length 3 describing estimation and optimization method.
numeric. Value of the optimized function.
list. Full outcome of an optimization function.
gCopula
and gCopulaEmpirical
return list containing
numeric. GOF test statistic.
numeric. 95% quantile or critical value from bootstrap simulations.
numeric. p-value from bootstrap simulations.
numeric vector. Copula parameters estimates.
character. Name of the supplied data object.
character. Identification of GoF test used.
character vector of length 3. Sumarizes estimation and optimiztion method.
character. Generator and depfu id, or copula id.
isCopula
returns list containing
logical. FALSE if any of copula properties is violated.
data frame. Consists of 1) index of variable, 2) violated property, 3) deviation from allowed range, 4) copula parameters for which the issue emerged.
vector, matrix or data frame with as many columns as variables. List of two such objects in case of gCopulaEmpirical
.
list containing archimedean generator, it's inverse, parameter bounds and possibly derivatives. See generator
.
list containing Pickand's dependence function, parameter bounds and possibly derivatives. See depfun
.
list containing generic copula CDF and/or PDF, parameter values and bounds. See copula
.
either numeric vector of generic copula parameters, or list of two vectors: generator parameters and dependence function parameters.
numeric vector of generator
parameters, NULL
in trivial case.
numeric vector of depfun
parameters, NULL
in trivial case.
numeric. Index of the quantile variable among other variables; if NULL
(default) then no quantile is computed.
numeric. Probability corresponding to the wanted quantile. Replicated to length of the data. By default quantile
-th column of data
.
integer. Parameter passed to nintegrate
.
parameter passed to nderive
.
data.frame or matrix. Data set from which an empirical copula is constructed.
parameter passed to nderive
.
logical. Whether to shrink difference
if [0,1] interval is exceeded. By default, area
is changed instead.
numeric. Index of variables to be conditioned on.
number of random observations to be generated.
number of dimensions of copula = number of variables.
list of two vectors: lower and upper bound of generator
, depfun
and generic copula parameters, respectively.
copula parameters estimation method: Maximum pseudo-likelihood "ML"
, Least square distance to empirical copula "LS"
and Inversion of correlation coefficient relation to copula parameter "icorr"
.
R optimization routine to estimate parameters ("optim"
, "nlminb"
, "nls"
) or "brute force" search over parameter grid ("grid"
). The last one is useful when the other methods give unsatisfactory results. "nls"
cannot be used with ML technique. Ignored with "icorr" technique.
optimisation algorithm used by optim
procedure.
character. Correlation coeficient used by icorr
technique, either "kendall" and "spearman".
list of control settings passed to optimization routines.
list of parameters values to create a grid from; any list item can be vector of elements named to match seq()
arguments; by default the sequence is constructed from glimits
,dlimits
,limits
, respectively, and pgrid
.
number of grid points in each dimension of parameters space. Used when gparameters, dparameters
are not supplied.
number of bootstrap cycles.
number of Monte Carlo cyles needed in approximation of parametric function if there is no analytical expression available.
number of cores to be used for p-value simulation. Parallelization requires package parallel
or multicore
and may not work on Windows OS.
integer. Number of data grid nodes used to check copula properties in.
numeric. How much to tolerate departure of numeric results from theoretical values/limits.
an object used to select a method.
further arguments passed to or from other methods.
Tomas Bacigal
Genest, C., Rémillard, B. and Beaudoin, D. (2009): Goodness-of-fit tests for copulas: A review and a power study. Insurance: Mathematics and Economics 44, 199--213.
Rémillard, B., Scaillet, O. (2009): Testing for equality between two copulas. Journal of Multivariate Analysis 100(3), 377--386.
generator
, depfun
, pCopula
## assign generator definition list with specific parameter
ge <- genGumbel(parameters=4)
## probability P(U<0.3,V<0.5)
pCopula(c(0.3,0.5),ge) #0.2906142
## quantile q for which P(U
Run the code above in your browser using DataLab