Description Usage Arguments Details Value Examples
MGL.reg.mixed
is used to fit bivariate MGL and MGL-EV copula regression models for continuous and semi-continuous variables.
1 2 3 4 5 6 7 8 9 10 11 12 | MGL.reg.mixed(
obs,
U,
U_,
f,
X,
copula = c("MGL", "MGL180", "MGL-EV", "MGL-EV180", "Gumbel", "MGB2"),
umin = 0,
hessian = TRUE,
initpar,
...
)
|
obs |
two-dimensional matrix for observations. |
U |
two-dimensional 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 |
two-dimensional matrix for the density function of marginal distributions. |
X |
design matrix. |
copula |
'MGL', 'MGL180', "MGL-EV", "MGL-EV180" |
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 optim
function. Y1 and Y2 are both continuous variables.
Y1: continuous data.
Y2: semi-continuous data where Y2>umin is continuous and Y2<=umin is discrete.
copula: "MGL180" and "MGLEV180" denote the survival MGL and survival MGL-EV copula respectively.
For "Gumbel" regression model, the copula parameter
δ_i = \exp(Xβ) + 1.
For "MGL", "MGL180", "MGL-EV", "MGL-EV180" regression model, the copula parameter
δ_i = \exp(Xβ),
where β is the vector of coefficients to be estimated in the copula regression.
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 16 17 18 19 20 21 22 23 24 | library(rMGLReg)
u <- cbind(earthqCHI$u1, earthqCHI$u2)
u_ <- cbind(earthqCHI$u1, earthqCHI$u2_)
y <- cbind(earthqCHI$y1, earthqCHI$y2)
f <- cbind(earthqCHI$f1, earthqCHI$f2)
obs <- y
U <- u
U_ <- u_
umin <- 20
library(splines)
X <- ns(earthqCHI$year, knots = quantile(earthqCHI$year, c(0.333, 0.667)), intercept = TRUE)
m.MGL180 <- MGL.reg.mixed(obs = y, U = U, U_ = U_, umin = umin, f = f, X = X,
copula = "MGL180",
method = "Nelder-Mead",
control = list(maxit = 100000),
initpar = c(0.64, 1.2, 1, -0.2))
m.MGLEV180 <- MGL.reg.mixed(obs = y, U = U, U_ = U_, umin = umin, f = f, X = X,
copula = "MGL-EV180",
method = "Nelder-Mead",
control = list(maxit = 100000),
initpar = c(-0.32, 1, 1, 1))
m.MGL180
m.MGLEV180
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.