cfit: Fitting of copula parameter by maximum likelihood

Description Usage Arguments Value References See Also Examples

Description

Calculates the maximum of the log-Likelihood function of a chosen Copula family by utilizing stats::optimise. Care has to be taken, since the data to base the estimation on, has to be normed to the inverval [0, 1].

Usage

1
cfit(copula, data, interval = NULL)

Arguments

copula

A copula object. Decides the copula family for which the log-Likelihood function is to be maximised.

data

Matrix or dataframe of appropriate dimension (n x d). The data to base the Likelihood on. Data points have to be normed, i.e. copula data has to lie within [0, 1]^d.

interval

double. Optional argument, a vector to supply a lower and upper bound of the interval to be searched for the maximum. If not supplied, a very extensive interval within the appropriate parameter space will be chosen. Plotting the log-Likelihood function to decide upon an interval is recommended.

Value

A list of class "fitcop" inheriting the class of the supplied copula object, with identical elements to the original object, aside from the maximum likelihood estimate replacing the original parameter value. With two additional elements

loglikelihood

The maximum value of the log-likelihood of the supplied copula.

observations

The number of observations the estimation was based on.

References

Hofert et al. (2012). Likelihood inference for Archimedean copulas in high dimensions under known margins. Journal of Multivariate Analysis 110, 133-150.

See Also

cloglik, c_aic and c_bic

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
exc <- claycop(par = 5, dim = 2)
U <- matrix(c(0.7026, 0.6359, 0.4116, 0.8833, 0.3127, 0.4035), nrow = 3,
byrow = TRUE)
fit <- cfit(copula = exc, data = U)

# Choice of an interval could be based on a visual inspection of the
#log-likelihood function:
xpar <- seq(from = 0.1, to = 10, length.out = 100)
ll <- rep(NA, times = 100)
for (i in 1:100) {
  ll[i] <- cloglik(exc, data = U, parameter = xpar[i])
  }
plot(x = xpar, y = ll, xlab = "Parameter value", ylab = "log-likelihood")

AlexanderRitz/copR documentation built on Oct. 30, 2019, 4:11 a.m.