Description Usage Arguments Details Value Examples
View source: R/MGL-mle-mixed.r
MGL.mle.mixed
is used to fit bivariate mixed copula regression models via maximum likelihood (ML) method for continuous and semi-continuous variables.
1 2 3 4 5 6 7 8 9 10 11 | MGL.mle.mixed(
obs,
U,
U_,
f,
copula = c("MGL", "MGL180", "MGL-EV", "MGL-EV180", "Gumbel", "Normal", "MGB2", "t"),
umin,
hessian = TRUE,
initpar,
...
)
|
obs |
two-dimensional matrix for loss observations (y1, y2). |
U |
two-dimenstional matrix for pseudo copula data with values in [0,1] for (F(y1), F(y2)). |
U_ |
two-dimensional matrix for pseudo copula data for the data (F(y1), F(y2-1)). |
f |
values of the density function for marginal distribution. |
copula |
copula 'MGL', 'MGL180', "MGL-EV", "MGL-EV180", "MGB2", "Normal" , "t". |
umin |
threshold value used in the semi-continuous data. |
hessian |
Logical. Should a numerically differentiated Hessian matrix be returned? |
initpar |
Initial values for the parameters to be optimized over. |
... |
additional arguments, see |
The estimation method is performed via nlm
function.
Y1: continuous variable
Y2: semi-continuous variable when Y2>umin, it is continuous and Y2<=umin is discrete.
For a portfolio of n observations (y_{i1},y_{i2}; \; i=1,…,n), the joint density function of (Y_1,Y_2) can be written as
f_{Y_{1},Y_2}(y_{i1},y_{i2})=\begin{cases} f_{Y_1}(y_{i1})[ h_{2|1}(F_{Y_{1}}(y_{i1}),F_{Y_{2}}(y_{i2})) - h_{2|1}(F_{Y_{1}}(y_{i1}),F_{Y_{2}}(y_{i2}-1)) ], & y_{i2}≤ umin,\\ f_{Y_1}(y_{i1})f_{Y_2}(y_{i2})c(F_{Y_{1}}(y_{i1}), F_{Y_{2}}(y_{i2})), & y_{i2} > umin, \end{cases}
where the density f_{Y_j}(\cdot) and cdf F_{Y_j}(\cdot) of the marginal distributions (i=1,2) are specified respectively. Here h_{2|1}(u_1, u_2)=\partial C(u_1,u_2)/\partial u_1 is the h-function of bivariate copula.
copula:
"MGB2" is multivariate GB2.
"Normal" and "t" denote the Gaussian copula and Student-t copula respectively.
"MGL" and "MGL-EV" denote the MGL and MGL-EV copula respectively.
"MGL180" and "MGL-EV180" denote the survival MGL and survival MGL-EV copula respectively.
"Gumbel" is Gumbel copula.#'
A list containing the following components:
loglike: the value of the estimated maximum of the loglikelihood function.
copula: the name of the fitted copula. "MGL180" and "MGL-EV180" denote the survival MGL and MGL-EV copula respectively.
estimates: the point at which the maximum value of the loglikelihood is obtained.
se: the standard errors of the estimators.
AIC, BIC: the goodness fit of the regression models.
hessian: the hessian at the estimated maximum of the loglikelihood (if requested).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | library(rMGLReg)
# load the Chinese earthquake data set
u <- cbind(earthqCHI$u1, earthqCHI$u2) # cdf of marginal distribution
u_ <- cbind(earthqCHI$u1, earthqCHI$u2_) # cdf of marginal distribution for Y1 and Y2 - 1
y <- cbind(earthqCHI$y1, earthqCHI$y2) # observations
f <- cbind(earthqCHI$f1, earthqCHI$f2) # pdf of marginal distribution
obs <- y
U <- u
U_ <- u_
umin <- 20
m.MGLMGA180 <- MGL.mle.mixed(obs = y, U = U, U_ = U_,
umin = umin, f = f,
copula = "MGL180",
method = "L-BFGS-B", initpar = c(2))
m.MGLMGA180
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.