Learn R Programming

copula (version 0.9-5)

fitCopula: Estimation of the dependence parameters in copula models

Description

Fits a copula model to multivariate data belonging to the unit hypercube. The data can be pseudo-observations constructed from empirical or parametric marginal c.d.f.s, or from true observations from the copula.

Usage

loglikCopula(param, x, copula, suppressMessages=FALSE)
fitCopula(copula, data, method="mpl", start=NULL, lower=NULL, upper=NULL,
          optim.control = list(NULL), optim.method = "BFGS",
          estimate.variance = TRUE)

Arguments

param
a vector of parameter values.
x
a data matrix.
data
a data matrix.
copula
a "copula" object.
suppressMessages
logical, if TRUE, warnings messages from evaluating loglikelihood at invalid parameter values are suppressed.
method
can be either "ml" (maximum likelihood), "mpl" (maximum pseudo-likelihood), "itau" (inversion of Kendall's tau), and "irho" (inversion of Spearman's rho). The last three methods assume that t
start
a vector of starting value for "param".
lower, upper
bounds on the variables for the "L-BFGS-B" method.
optim.control
a list of controls to be passed to "optim".
optim.method
the method for "optim".
estimate.variance
logical, if TRUE, the large-sample variance is estimated.

Value

  • The return value of "loglikCopula" is the loglikelihood evaluated at the given value of "param". The return values of "fitCopula" is an object of class "fitCopula" ontaining slots:
  • estimatethe estimate of the parameters.
  • var.estlarge-sample variance estimate of the parameter estimator.
  • methodthe estimation method.
  • loglikloglikelihood at "est".
  • copulathe fitted copula.

References

C. Genest (1987). Frank's family of bivariate distributions. Biometrika 74, 549-555.

C. Genest and L.-P. Rivest (1993). Statistical inference procedures for bivariate Archimedean copulas. Journal of the American Statistical Association 88, 1034-1043. P. Rousseeuw and G. Molenberghs (1993). Transformation of nonpositive semidefinite correlation matrices. Communications in Statistics: Theory and Methods 22, 965-984. C. Genest, K. Ghoudi and L.-P. Rivest (1995). A semiparametric estimation procedure of dependence parameters in multivariate families of distributions. Biometrika, 82, 543-552.

H. Joe (2005). Asymptotic efficiency of the two-stage estimation method for copula-based models. Journal of Multivariate Analysis 94, 401-419. S. Demarta and A. McNeil (2005). The t copula and related copulas. International Statistical Review 73, 111-129. C. Genest and A.-C. Favre (2007). Everything you always wanted to know about copula modeling but were afraid to ask. Journal of Hydrologic Engineering 12, 347-368. I. Kojadinovic and J. Yan (2010). Comparison of three semiparametric methods for estimating dependence parameters in copula models. Insurance: Mathematics and Economics, in press.

See Also

Copula, mvdc, gofCopula.

Examples

Run this code
gumbel.cop <- gumbelCopula(3, dim=2)

n <- 200
x <- rcopula(gumbel.cop, n)       ## true observations
u <- apply(x, 2, rank) / (n + 1)  ## pseudo-observations
## inverting Kendall's tau
fit.tau <- fitCopula(gumbel.cop, u, method="itau")
fit.tau
## inverting Spearman's rho
fit.rho <- fitCopula(gumbel.cop, u, method="irho")
fit.rho
## maximum pseudo-likelihood
fit.mpl <- fitCopula(gumbel.cop, u, method="mpl")
fit.mpl
## maximum likelihood
fit.ml <- fitCopula(gumbel.cop, x, method="ml")
fit.ml

## a multiparameter example
normal.cop <- normalCopula(c(0.6,0.36, 0.6),dim=3,dispstr="un")
x <- rcopula(normal.cop, n)     ## true observations
u <- apply(x, 2, rank) / (n + 1)  ## pseudo-observations
## inverting Kendall's tau
fit.tau <- fitCopula(normal.cop, u, method="itau")
fit.tau
## inverting Spearman's rho
fit.rho <- fitCopula(normal.cop, u, method="irho")
fit.rho
## maximum pseudo-likelihood
fit.mpl <- fitCopula(normal.cop, u, method="mpl")
fit.mpl
## maximum likelihood
fit.ml <- fitCopula(normal.cop, x, method="ml")
fit.ml
## with dispstr="toep"
normal.cop.toep <- normalCopula(c(0, 0), dim=3, dispstr="toep")
## inverting Kendall's tau
fit.tau <- fitCopula(normal.cop.toep, u, method="itau")
fit.tau
## inverting Spearman's rho
fit.rho <- fitCopula(normal.cop.toep, u, method="irho")
fit.rho
## maximum pseudo-likelihood
fit.mpl <- fitCopula(normal.cop.toep, u, method="mpl")
fit.mpl
## maximum likelihood
fit.ml <- fitCopula(normal.cop.toep, x, method="ml")
fit.ml
## with dispstr="ar1"
normal.cop.ar1 <- normalCopula(c(0), dim=3, dispstr="ar1")
## inverting Kendall's tau
fit.tau <- fitCopula(normal.cop.ar1, u, method="itau")
fit.tau
## inverting Spearman's rho
fit.rho <- fitCopula(normal.cop.ar1, u, method="irho")
fit.rho
## maximum pseudo-likelihood
fit.mpl <- fitCopula(normal.cop.ar1, u, method="mpl")
fit.mpl
## maximum likelihood
fit.ml <- fitCopula(normal.cop.ar1, x, method="ml")
fit.ml

## a t copula with df.fixed=FALSE
t.cop <- tCopula(c(0.2,0.4,0.6),dim=3,dispstr="un",df=5)
x <- rcopula(t.cop, n)     ## true observations
u <- apply(x, 2, rank) / (n + 1)  ## pseudo-observations
## maximum likelihood
fit.ml <- fitCopula(t.cop, x, method="ml", start=c(0,0,0,10))
fit.ml
## maximum pseudo-likelihood; the asymptotic variance cannot be estimated 
fit.mpl <- fitCopula(t.cop, u, method="mpl", start=c(0,0,0,10),
                     estimate.variance=FALSE)
fit.mpl

Run the code above in your browser using DataLab