copula
object.dCopula(u, copula, log=FALSE, ...)
pCopula(u, copula, ...)
rCopula(n, copula, ...)
"Copula "
,
(i.e., "copula "
or "nacopula "
).rCopula()
:) number of observations to be generated.method
.dCopula()
gives the density, pCopula()
gives the
distribution function, and rCopula()
generates random variates.dCopula
) and distribution function
(pCopula
) methods for Archimedean copulas now use the
corresponding function slots of the Archimedean copula objects, such
as copClayton
, copGumbel
, etc. The distribution function of a t
copula uses pmvt
from
package dCopula
) calls
dmvt
from normalCopula
methods use dmvnorm
and pmvnorm
from the same package.
The random number generator for an Archimedean copula uses the conditional approach for the bivariate case and the Marshal-Olkin (1988) approach for dimension greater than 2.
Genest, C. and Favre, A.-C. (2007). Everything you always wanted to know about copula modeling but were afraid to ask. Journal of Hydrologic Engineering 12, 347--368.
Joe, H. (1997). Multivariate Models and Dependence Concepts. Chapman and Hall, London.
Marshall, A. W. and Olkin, I. (1988) Families of multivariate distributions. Journal of the American Statistical Association 83, 834--841.
Nelsen, R. B. (2006) An introduction to Copulas. Springer, New York.
copula
and acopula
classes, the acopula families, acopula-families
.
Constructor functions such as
ellipCopula
, archmCopula
,
fgmCopula
.norm.cop <- normalCopula(0.5)
norm.cop
x <- rCopula(100, norm.cop)
plot(x)
dCopula(x, norm.cop)
pCopula(x, norm.cop)
persp(norm.cop, dCopula)
contour(norm.cop, pCopula)
## a 3-dimensional normal copula
u <- rCopula(1000, normalCopula(0.5, dim = 3))
if(require("scatterplot3d"))
scatterplot3d(u)
## a 3-dimensional clayton copula
cl3 <- claytonCopula(2, dim = 3)
v <- rCopula(1000, cl3)
pairs(v)
if(require("scatterplot3d"))
scatterplot3d(v)
## Compare with the "nacopula" version :
fu1 <- dCopula(v, cl3)
fu2 <- copClayton@dacopula(v, theta = 2)
Fu1 <- pCopula(v, cl3)
Fu2 <- pnacopula(onacopula("Clayton", C(2.0, 1:3)), v)
## The density and cumulative values are the same:
stopifnot(all.equal(fu1, fu2, tol= 1e-14),
all.equal(Fu1, Fu2, tol= 1e-15))
Run the code above in your browser using DataLab