Learn R Programming

copula (version 0.999-1)

fitMvdc: Estimation of multivariate models defined via copulas

Description

Fits a copula-based multivariate distribution to multivariate data.

Usage

loglikMvdc(param, x, mvdc, suppressMessages=FALSE)
fitMvdc(data, mvdc, start, optim.control = list(), method = "BFGS")

Arguments

param
a vector of parameter values. When specifying parameters for mvdc objects the parameters should be ordered with the marginals first and the copula parameters last. When the mvdc object has marginsIdentical = T
x
a data matrix.
mvdc
a "mvdc" object.
suppressMessages
logical, if TRUE, warnings messages from evaluating loglikelihood at invalid parameter values are suppressed.
data
a data matrix.
start
a vector of starting value for "param". See "param" above for ordering of this vector.
optim.control
a list of controls to be passed to optim.
method
the method for optim.

Value

  • The return value loglikMvdc() is the log likelihood evaluated for the given value of param.

    The return value of fitMvdc() is an object of class "fitMvdc", containing slots:

  • estimatethe estimate of the parameters.
  • var.estlarge-sample variance estimate of the parameter estimator.
  • loglikloglikelihood at estimate.

See Also

Copula, fitCopula, gofCopula.

Examples

Run this code
gumbel.cop <- gumbelCopula(3, dim=2)
myMvd <- mvdc(gumbel.cop, c("exp","exp"),
              list(list(rate=2), list(rate=4)))
x <- rMvdc(10000, myMvd)
## the example is typically not run with CRAN checking:
(doExtras <- interactive() || nzchar(Sys.getenv("R_copula_check_extra")) ||
 identical("true", unname(Sys.getenv("R_MM_PKG_CHECKING"))))
if(doExtras) {
 ## Takes about  25 sec. [2012-07]:
 fit <- fitMvdc(x, myMvd, start = c(1,1,2))
 print(fit)
}

## Roger Koenker prepared a demo illustrating MLE for a Clayton AR(1)
## copula model with identical, user-defined Student marginals
if(FALSE) ## not yet ok %% FIXME !
demo("QARClayton")

Run the code above in your browser using DataLab