Learn R Programming

BivarP (version 1.0)

BiVarEst: Estimation of the parameters of the bivariate distribution function of the Archimedean copula family.

Description

Estimation the parameters of the bivariate distribution function of the Archimedean copula family.

Usage

BiVarEst(Z, kopule = "gumbel", rodiny = c("weibull", "weibull"))

Arguments

Z
data frame with these columns: Z[, 1:2] are numeric vectors. Z[, 3] is an integer vector consisting of 0 or 1. Z[i, 3] = 0, if Z[i, 1] is censored. Z[, 4] is an integer vector consisting of 0 or 1. Z[i, 4] = 0, if Z[i, 2] is censored.
kopule
a character string specifying the family of an Archimedean copula. Currently supported families are "gumbel", "clayton" and "frank".
rodiny
vector of length 2 of names of the marginal distributions. Names can be "weibull", "gamma", "norm" and "lnorm". "norm" is the name for the Normal distribution. "lnorm" is the name for the Lognormal distribution.

Value

A list with the following components:
par
best estimate of the parameter vector found by the nmkb function.
value
value of the likelihood at termination.
feval
number of times the likelihood was evaluated.
restarts
number of times the algorithm had to be restarted when it stagnated.
convergence
an integer code indicating type of convergence. 0 indicates successful convergence. Positive integer codes indicate failure to converge.
message
a text message indicating the type of convergence or failure.

Details

The Weibull ("weibull") and the Gamma ("gamma") distributions have parameters shape and scale. The Normal ("norm") distribution has parameters mean and sd. The Lognormal ("lnorm") distribution has parameters meanlog and sdlog.

Examples

Run this code
rodinka <- c("weibull", "norm")
kopule <- "frank"
xweib <- c(1.75, 145, 1.30, 80, 3.5)
BcG <- BiCopGen(x = xweib, rodiny = rodinka, rodina = kopule, No=30,
cens = TRUE, bicens = FALSE, digi = 2)
Nxyd <- data.frame(X=BcG$X, Y=BcG$Y, dX=BcG$dX, dY=BcG$dY)
Bivar <- BiVarEst(Nxyd, kopule = kopule, rodiny = rodinka)
Bivar
plot(Nxyd$Y, Nxyd$X, type="n", xlab="Y", ylab="X",
xlim=c(min(0, min(Nxyd$Y)), max(Nxyd$Y)),
ylim=c(min(0, min(Nxyd$X)),max(Nxyd$X)))
points(Nxyd$Y, Nxyd$X, col=ifelse(Nxyd$dX==1 & Nxyd$dY==1, "black",
ifelse(Nxyd$dX==0 & Nxyd$dY==1, "red", ifelse(Nxyd$dX==1 & Nxyd$dY==0,
"blue", "green"))), pch=20)
legend("topleft",c("dX, dY","1,1", "0,1", "1,0", "0,0"),
text.col=c("black", "black", "red", "blue", "green"), bty = "n")
grid(col = "grey50")

Run the code above in your browser using DataLab