MGL.reg.mixed.Rd
MGL.reg.mixed
is used to fit bivariate MGL and MGL-EV copula regression models for continuous and semi-continuous variables.
MGL.reg.mixed(
obs,
U,
U_,
f,
X,
copula = c("MGL", "MGL180", "MGL-EV", "MGL-EV180", "Gumbel", "MGB2"),
umin = 0,
hessian = TRUE,
initpar,
...
)
two-dimensional matrix for observations.
two-dimensional matrix for pseudo copula data with values in \([0,1]\) for (F(y1), F(y2)).
two-dimensional matrix for pseudo copula data for the data (F(y1), F(y2-1)).
two-dimensional matrix for the density function of marginal distributions.
design matrix.
'MGL', 'MGL180', "MGL-EV", "MGL-EV180"
threshold value used in the semi-continuous data.
Logical. Should a numerically differentiated Hessian matrix be returned?
Initial values for the parameters to be optimized over.
additional arguments, see optim
for more details.
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).
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 $$\delta_i = \exp(X\beta) + 1.$$
For "MGL", "MGL180", "MGL-EV", "MGL-EV180" regression model, the copula parameter $$\delta_i = \exp(X\beta),$$ where \(\beta\) is the vector of coefficients to be estimated in the copula regression.
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
#> $loglike
#> [1] -3002.216
#>
#> $copula
#> $copula$name
#> [1] "MGL180"
#>
#>
#> $estimates
#> [1] 0.6335636 1.7222609 1.8482879 -0.2495413
#>
#> $se
#> [1] 0.3331746 0.2919771 0.3862413 0.3407179
#>
#> $hessian
#> [,1] [,2] [,3] [,4]
#> [1,] -15.255498 -7.0269080 -8.299759 1.7418354
#> [2,] -7.026908 -17.7331530 -8.965614 -0.4904041
#> [3,] -8.299759 -8.9656143 -14.412310 -3.2798214
#> [4,] 1.741835 -0.4904041 -3.279821 -10.6878692
#>
#> $AIC
#> [1] 6012.431
#>
#> $BIC
#> [1] 6027.124
#>
m.MGLEV180
#> $loglike
#> [1] -3004.762
#>
#> $copula
#> $copula$name
#> [1] "MGL-EV180"
#>
#>
#> $estimates
#> [1] 0.3334915 1.3270662 1.0505622 -0.2111104
#>
#> $se
#> [1] 0.3892632 0.3113927 0.3553789 0.3571050
#>
#> $hessian
#> [,1] [,2] [,3] [,4]
#> [1,] -15.675946 -7.633866 -8.261542 4.374247
#> [2,] -7.633866 -15.716414 -6.014448 -2.002361
#> [3,] -8.261542 -6.014448 -13.660477 -1.447256
#> [4,] 4.374247 -2.002361 -1.447256 -11.533344
#>
#> $AIC
#> [1] 6017.524
#>
#> $BIC
#> [1] 6032.217
#>