MGL.reg: Fitting bivariate/multivariate MGL and MGL-EV copula...

Description Usage Arguments Details Value Examples

View source: R/MGLReg.r

Description

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

Usage

1
2
3
4
5
6
7
8
MGL.reg(
  U,
  X,
  copula = c("MGL", "MGL180", "MGL-EV", "MGL-EV180", "Gumbel", "MGB2"),
  hessian = TRUE,
  initpar,
  ...
)

Arguments

U

two-dimensional matrix with values in [0,1].

X

design matrix

copula

'MGL', 'MGL180', "MGL-EV", "MGL-EV180", "Gumbel", "MGB2".

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
# 10-dimensional regression models
set.seed(111)
d <- 10
n <- 1000 # sample size
beta.true <- c(-0.6, 0.5, 0.2) # true regression coefficients
x1 <- rnorm(n, 0, 1)
x2 <- rnorm(n, 0, 1)
X <- model.matrix(~ x1 + x2) # design matrix
delta.sim <- as.vector(exp(X%*%beta.true)) # true copula parameters
Usim <- matrix(0, nrow = n, ncol = d)
for (i in 1:n){
  Usim[i, ] <- rcMGL.multi(n = 1, d = d, pars = delta.sim[i])
}
m.MGLMGA <- MGL.reg(U = Usim, copula = "MGL",
                       X = X, method = "Nelder-Mead",
                       initpar = c(-0.32, 0.001, 0.001)
)
m.MGLMGA

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