BiVarEst: Estimation of the parameters of the bivariate distribution...

Description Usage Arguments Details Value Note Author(s) Examples

Description

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

Usage

1
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.

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.

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.

Note

Vector par has the structure:
par[1:2] are parameters of the first marginal distribution.
par[3:4] are parameters of the second marginal distribution.
par[5] is the parameter of the copula.

Author(s)

Josef Brejcha

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
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")

Example output

Loading required package: dfoptim
Loading required package: survival
Loading required package: copula
$par
[1]   1.765095 157.892901  15.718961  57.549406   6.154903

$value
[1] 136.2671

$feval
[1] 202

$restarts
[1] 0

$convergence
[1] 0

$message
[1] "Successful convergence"

BivarP documentation built on May 2, 2019, 6:08 a.m.