glm.regu.path: Regularied M-estimation for fitting generalized linear models...

Description Usage Arguments Details Value References Examples

View source: R/regu-est-c.r

Description

This function implements regularized M-estimation for fitting generalized linear models with binary or contiunous responses along a regularization path.

Usage

1
2
3
glm.regu.path(nrho = NULL, rho.seq = NULL, y, x, iw = NULL,
  loss = "cal", n.iter = 100, eps = 1e-06, tune.fac = 0.5,
  tune.cut = TRUE, ann.init = TRUE, nz.lab = NULL)

Arguments

nrho

The number of tuning parameters in a regularization path.

rho.seq

A vector of tuning parameters in a regularization path. If both nrho and rho.seq are specified, then rho.seq overrides nrho.

y

An n x 1 response vector.

x

An n x p matix of covariates, excluding a constant.

iw

An n x 1 weight vector.

loss

A loss function, which can be specified as "gaus" for continuous responses, or "ml" or "cal" for binary respones.

n.iter

The maximum number of iterations allowed as in glm.regu.

eps

The tolerance used to declare convergence as in glm.regu.

tune.fac

The multiplier (factor) used to define rho.seq if only nrho is specified.

tune.cut

Logical; if TRUE, all smaller tuning parameters are skipped once non-convergence is found with a tuning parameter.

ann.init

Logical; if TRUE, the estimates from the previous tuning parameter are used as the inital value when fitting with the current tuning parameter.

nz.lab

A p x 1 logical vector (useful for simulations), indicating which covariates are included when calculating the number of nonzero coefficients.

Details

If not specified by users, the sequence of tuning parameters (i.e., the regularization path) is defined as a geometric series of length nrho, starting from the value which yields a zero solution, and then decreasing by a factor tune.fac successively.

Value

rho

The vector of tuning parameters included in the regularization path.

non.conv

A vector indicating the non-convergene status found or imputed if tune.cut=TRUE, along the regularization path. For each tuning parameter, 0 indicates convergence, 1 non-convergence if exceeding n.iter, 2 non-convergence if exceeding bt.lim.

nz.all

A vector giving the numbers of nonzero coefficients estimated, along the regularization path.

bet.all

A matrix giving estimated intercept and coefficients, column by column, along the regularization path.

fit.all

A matrix giving fitted values, column by column, along the regularization path.

References

Tan, Z. (2020a) Regularized calibrated estimation of propensity scores with model misspecification and high-dimensional data, Biometrika, 107, 137<e2><80><93>158.

Tan, Z. (2020b) Model-assisted inference for treatment effects using regularized calibrated estimation with high-dimensional data, Annals of Statistics, 48, 811<e2><80><93>837.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
data(simu.data)
n <- dim(simu.data)[1]
p <- dim(simu.data)[2]-2

y <- simu.data[,1]
tr <- simu.data[,2]
x <- simu.data[,2+1:p]
x <- scale(x)

### Example 1: linear regression
out.rgaus.path <- glm.regu.path(rho.seq=c(.01, .02, .05, .1, .2, .5), y=y[tr==1], x=x[tr==1,], 
                                loss="gaus")

# the estimated intercept and coefficients; the first 10 are shown
out.rgaus.path$bet.all[1:10,]

### Example 2: logistic regression using likelihood loss
out.rml.path <- glm.regu.path(rho.seq=c(.002, .005, .01, .02, .05, .1), y=tr, x=x, loss="ml")
out.rml.path$bet.all[1:10,]

### Example 3: logistic regression using calibration loss
out.rcal.path <- glm.regu.path(rho.seq=c(.005, .01, .02, .05, .1, .2), y=tr, x=x, loss="cal")
out.rcal.path$bet.all[1:10,]

RCAL documentation built on Nov. 8, 2020, 4:22 p.m.