MGL.reg.mixed: Fitting bivariate mixed MGL and MGL-EV copula regression...

Description Usage Arguments Details Value Examples

View source: R/MGLReg-mixed.r

Description

MGL.reg.mixed is used to fit bivariate MGL and MGL-EV copula regression models for continuous and semi-continuous variables.

Usage

 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,
  ...
)

Arguments

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 optim for more details.

Details

The estimation method is performed via optim function. Y1 and Y2 are both continuous variables.

copula: "MGL180" and "MGLEV180" denote the survival MGL and survival MGL-EV copula respectively.

Value

A list containing the following components:

Examples

 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

lizhengxiao/rMGLReg documentation built on Jan. 2, 2022, 8:52 a.m.