plsim.vs.soft {PLSiMCpp}R Documentation

Penalized Profile Least Squares Estimator

Description

PPLS along with introducing penalty terms so as to simultaneously estimate parameters and select important variables in PLSiM

Y = \eta(Z^T\alpha) + X^T\beta + \epsilon

.

Usage

plsim.vs.soft(...)

## S3 method for class 'formula'
plsim.vs.soft(formula, data, ...)

## Default S3 method:
plsim.vs.soft(xdat=NULL, zdat, ydat, h=NULL, zetaini=NULL, 
lambda=0.01, l1_ratio=NULL, MaxStep = 1L, penalty = "SCAD", verbose=TRUE, 
ParmaSelMethod="SimpleValidation", TestRatio=0.1, K = 3, seed=0, ...)

Arguments

...

additional arguments.

formula

a symbolic description of the model to be fitted.

data

an optional data frame, list or environment containing the variables in the model.

xdat

input matrix (linear covariates). The model reduces to a single index model when x is NULL.

zdat

input matrix (nonlinear covariates). z should not be NULL.

ydat

input vector (response variable).

h

a value or a vector for bandwidth. If h is NULL, a default vector c(0.01,0.02,0.05,0.1,0.5) will be set for it. plsim.bw is employed to select the optimal bandwidth when h is a vector or NULL.

zetaini

initial coefficients, optional (default: NULL). It could be obtained by the function plsim.ini. zetaini[1:ncol(z)] is the initial coefficient vector \alpha_0, and zetaini[(ncol(z)+1):(ncol(z)+ncol(x))] is the initial coefficient vector {\beta}_0.

MaxStep

int, optional (default=1). Hard limit on iterations within solver.

lambda

double. Constant that multiplies the penalty term.

l1_ratio

double, default=NULL. It should be set with a value from the range [0,1] when you choose "ElasticNet" for the parameter penalty.

penalty

string, optional (default="SCAD"). It could be "SCAD", "LASSO" and "ElasticNet".

verbose

bool, default: TRUE. Enable verbose output.

ParmaSelMethod

the parameter for the function plsim.bw.

TestRatio

the parameter for the function plsim.bw.

K

the parameter for the function plsim.vs.soft.

seed

int, default: 0.

Value

eta

estimated non-parametric part \hat{\eta}(Z^T{\hat{\alpha} }).

zeta

estimated coefficients. zeta[1:ncol(z)] is \hat{\alpha}, and zeta[(ncol(z)+1):(ncol(z)+ncol(x))] is \hat{\beta}.

y_hat

y's estimates.

mse

mean squared errors between y and y_hat.

data

data information including x, z, y, bandwidth h, initial coefficients zetaini, iteration step MaxStep, flag SiMflag, penalty, lambda and l1_ratio. SiMflag is TRUE when x is NULL, otherwise SiMflag is FALSE.

Z_alpha

Z^T{\hat{\alpha}}.

r_square

multiple correlation coefficient.

variance

variance of y_hat.

stdzeta

standard error of zeta.

References

H. Liang, X. Liu, R. Li, C. L. Tsai. Estimation and testing for partially linear single-index models. Annals of statistics, 2010, 38(6): 3811.

Examples

 
# EXAMPLE 1 (INTERFACE=FORMULA)
# To estimate parameters of partially linear single-index model and select 
# variables using different penalization methods such as SCAD, LASSO, ElasticNet.

n = 50
sigma = 0.1

alpha = matrix(1,2,1)
alpha = alpha/norm(alpha,"2")

beta = matrix(4,1,1)

# Case 1: Matrix Input
x = matrix(1,n,1)
z = matrix(runif(n*2),n,2)
y = 4*((z%*%alpha-1/sqrt(2))^2) + x%*%beta + sigma*matrix(rnorm(n),n,1)

# Compute the penalized profile least-squares estimator with the SCAD penalty
fit_scad = plsim.vs.soft(y~x|z,lambda = 0.01)
summary(fit_scad)

# Compute the penalized profile least-squares estimator with the LASSO penalty
fit_lasso = plsim.vs.soft(y~x|z,lambda = 1e-3, penalty = "LASSO")
summary(fit_lasso)

# Compute the penalized profile least-squares estimator with the ElasticNet penalty
fit_enet = plsim.vs.soft(y~x|z,lambda = 1e-3, penalty = "ElasticNet")
summary(fit_enet)

# Case 2: Vector Input
x = rep(1,n)
z1 = runif(n)
z2 = runif(n) 
y = 4*((z%*%alpha-1/sqrt(2))^2) + x%*%beta + sigma*matrix(rnorm(n),n,1)

# Compute the penalized profile least-squares estimator with the SCAD penalty
fit_scad = plsim.vs.soft(y~x|z1+z2,lambda = 0.01)
summary(fit_scad)

# Compute the penalized profile least-squares estimator with the LASSO penalty
fit_lasso = plsim.vs.soft(y~x|z1+z2,lambda = 1e-3, penalty = "LASSO")
summary(fit_lasso)

# Compute the penalized profile least-squares estimator with the ElasticNet penalty
fit_enet = plsim.vs.soft(y~x|z1+z2,lambda = 1e-3, penalty = "ElasticNet")
summary(fit_enet)

# EXAMPLE 2 (INTERFACE=DATA FRAME)
# To estimate parameters of partially linear single-index model and select 
# variables using different penalization methods such as SCAD, LASSO, ElasticNet.

n = 50
sigma = 0.1

alpha = matrix(1,2,1)
alpha = alpha/norm(alpha,"2")

beta = matrix(4,1,1)

x = rep(1,n)
z1 = runif(n)
z2 = runif(n) 
X = data.frame(x)
Z = data.frame(z1,z2)

x = data.matrix(X)
z = data.matrix(Z)
y = 4*((z%*%alpha-1/sqrt(2))^2) + x%*%beta + sigma*matrix(rnorm(n),n,1)

# Compute the penalized profile least-squares estimator with the SCAD penalty
fit_scad = plsim.vs.soft(xdat=X,zdat=Z,ydat=y,lambda = 0.01)
summary(fit_scad)

# Compute the penalized profile least-squares estimator with the LASSO penalty
fit_lasso = plsim.vs.soft(xdat=X,zdat=Z,ydat=y,lambda = 1e-3, penalty = "LASSO")
summary(fit_lasso)

# Compute the penalized profile least-squares estimator with the ElasticNet penalty
fit_enet = plsim.vs.soft(xdat=X,zdat=Z,ydat=y,lambda = 1e-3, penalty = "ElasticNet")
summary(fit_enet)


[Package PLSiMCpp version 1.0.4 Index]