mvr: Estimate coefficients of high-dimensional multivariate...

Description Usage Arguments Value Author(s) References Examples

View source: R/mvr.R

Description

This function provides the coefficient matrix estimator of high-dimensional multivariate regression (MVR) with penalty lasso (mcp or scad). The tuning parameter is selected by BIC (the default), AIC, EBIC, CV, or GCV.

Usage

1
2
3
mvr(Y, X, Z=NULL, method="BIC", ncv=10, penalty="LASSO", isPenColumn=TRUE, 
          lambda=NULL, nlam=50, intercept=TRUE, lam_min=1e-4, eps=1e-6, 
          maxstep=20, gamma_pen=2, dfmax=NULL, alpha=1)

Arguments

Y

The response, a vector of size n or a matrix of size n\times q

X

The covariates to be penalized, a matrix with dimension n\times p

Z

The covariates without penalization, a matrix with dimension n\times d. The default is NULL.

method

The method to be applied to select parameters. Either BIC (the default), AIC, EBIC, CV, or GCV.

ncv

The number of cross-validation folds. Default is 10. If method is not CV, ncv is useless.

penalty

The penalty to be applied to the model. Either "LASSO" (the default), "SCAD", or "MCP".

isPenColumn

A logical value indicating whether the coefficients associating with X_j that affects whole response y is penalized. Default is TRUE. If isPenColumn is TRUE, the coefficients associating with X_j that affects simultaneously whole response y is penalized for each j\in \{1,\cdots,p\}. If isPenColumn is FALSE, the coefficients associating with X_j that affects single response y_l is penalized for each j\in \{1,\cdots,p\}, where l\in \{1,\cdots,q\}.

lambda

A user-specified sequence of lambda values. By default, a sequence of values of length nlam is computed, equally spaced on the log scale.

nlam

The number of lambda values. Default is 50.

intercept

Should intercept(s) be fitted (default=TRUE) or set to zero (FALSE)?

lam_min

The smallest value for lambda, as a fraction of lambda.max. Default is 1e-3.

eps

Convergence threshhold. The algorithm iterates until the relative change in any coefficient is less than eps1. Default is 1e-4.

maxstep

Maximum number of iterations. Default is 20.

gamma_pen

The tuning parameter of the MCP/SCAD penalty (see details).

dfmax

Upper bound for the number of nonzero coefficients. Default is no upper bound. However, for large data sets, computational burden may be heavy for models with a large number of nonzero coefficients.

alpha

Tuning parameter for the Mnet estimator which controls the relative contributions from the LASSO, MCP/SCAD penalty and the ridge, or L2 penalty. alpha=1 is equivalent to LASSO, MCP/SCAD penalty, while alpha=0 would be equivalent to ridge regression. However, alpha=0 is not supported; alpha may be arbitrarily small, but not exactly 0.

Value

Bhat

Estimator of Bhat.

rss

Residual sum of squares (RSS).

activeX

The active set of X. It is a p dimensional vector.

lambda

The sequence of regularization parameter values in the path.

selectedID

The index of lambda corresponding to lambda_opt.

lambda_opt

The value of lambda with the minimum BIC value.

bic

BIC value used to select variables.

muhat

Estimator of intercept μ. It is NULL if intercept is FALSE.

Chat

Estimator of coefficients of Z. Chat is NULL if Z is NULL.

Y

Response Y.

X

Design matrix X.

Author(s)

Chao Cheng, Xingdong Feng, Jian Huang and Xu Liu (liu.xu@sufe.edu.cn)

References

Cheng, C., Feng, X., Huang, J. and Liu, X. (2020). Regularized projection score estimation of treatment effects in high-dimensional quantile regression. Manuscript.

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
25
26
27
28
29
30
31
32
33
	library(pqr)
	
	#example 1
	n <- 200
	q <- 5
	s <- 3
	p <- 100
	B <- matrix(runif(q*s, 2,3), s)
	X <- matrix(rnorm(n*p),n,p)
	Y <- X[,1:s]%*%B + matrix(rnorm(n*q),n)
	fit <- mvr(Y,X)
	fit$activeX
	fit$Bhat
	which(rowSums(fit$Bhat^2)>0)
	fit$muhat
	
	#example 2
	n <- 200
	q <- 5
	s <- 3
	d <- 3
	p <- 100
	B <- matrix(runif(q*s, 2,3), s)
	C <- matrix(runif(q*d, 1,2), d)
	X <- matrix(rnorm(n*p),n,p)
	Z <- matrix(rnorm(n*d),n)
	Y <- X[,1:s]%*%B + Z%*%C + matrix(rnorm(n*q),n)
	fit <- mvr(Y,X,Z)
	fit$activeX
	fit$Bhat
	which(rowSums(fit$Bhat^2)>0)
	fit$Chat
	fit$muhat	

xliusufe/pqr documentation built on Feb. 5, 2020, 3:06 a.m.