pawls: Penalized adaptive weighted least squares regression

Description Usage Arguments Value Author(s) Examples

Description

Compute weighted least squares regression with L1 regularization on both the coefficients and weight vectors.

Usage

1
2
3
4
5
pawls(x, y, nlambda1 = 100, nlambda2 = 50, lambda1 = NULL,
  lambda2 = NULL, lambda1.min = 0.05, lambda2.min = 0.001, beta0 = NULL,
  w0 = NULL, initial = c("uniform", "PAWLS"), delta = 1e-06,
  maxIter = 1000, intercept = TRUE, standardize = TRUE,
  search = c("grid", "cross"))

Arguments

x

a numeric matrix containing the predictor variables without an intercept. pawls standardizes the data and includes an intercept by default.

y

a numeric vector containing the response variable.

nlambda1

the number of lambda1 values (the default is 100).

nlambda2

the number of lambda2 values (the default is 50).

lambda1

a numeric vector of non-negative values to be used as tuning parameters of the penalty for coefficients. By default, a sequence of values of length nlambda1 is computed, equally spaced on the log scale.

lambda2

a numeric vector of non-negative values to be used as tunning parameters of the penalty for weight vectors. By default, a sequence of values of length nlambda2 is computed, equally spaced on the log scale.

lambda1.min

a numeric value giving the smallest value for lambda1, as a fraction of the lambda1 maximum. The default is .05. Note that the lambda1 maximum is an estimate of tuning parameter that set all the coefficientes to 0.

lambda2.min

a numeric value giving the smallest value for lambda2, as a fraction of the lambda2 maximum. The default is .001. Note that the lambda2 maximum is an estimate of tuning parameter that set all the weights to 1.

beta0

the initial estimates of coefficients to be used in the adaptive penalty for beta.

w0

the initial estimates of weight vector to be used in the adaptive penalty for w.

initial

a character string specifying the initial estimates of both coeffcients and weight vectors in the adaptive penalties. If "uniform", a non-adaptive pawls is performed. If "pawls", then the estimates are obtained by non-adaptive pawls (the default is "uniform").

delta

a small positive numeric value as a convergence threshold. The algorithm iterates until the RMSD for the change in both coefficents and weight vectors is less than delta (the default is 1e-06).

maxIter

a positive numeric value used to determin the maximum number of iterations (the default is 1000).

intercept

a logical indicating whether a constant term should be included in the model (the default is TRUE).

standardize

a logical indicating whether the predictor variables should be normalized to have unit L2 norm (the default is TRUE).

search

a character string specifying the algorithm to select tunning parameters for both coefficients and weight vectors. If "cross", the optimal tuning parameters are searched alternatively by minimizing BIC. If "grid", the optimal tuning parameters are selected as the pair that minimizs BIC over a fine grid. The default is "grid".

Value

An object of class "pawls.cross"(if search=cross) or "pawls.grid" (if search=grid) contaning:

beta

a numeric vector containing the respective coefficient estimates with the optimal tuning parameters.

w

a numeric vector containing the respective weight estimates with the optimal tuning parameters.

lambda1

same as above.

lambda2

same as above.

opt.lambda1

a numeric value giving the optimal lambda1 in the sense of minimzing BIC.

opt.lambda2

a numeric value giving the optimal lambda2 in the sense of minimzing BIC.

iter

a numeric matrix with nlambda2 rows and nlambda1 columns giving the number of iteration until convergence at each pair of tuning parameters(search=grid) or a nueric value giving the number of iteration in corss search until convergence(search=cross).

betas

a 3-dimension numeric array containing the coefficient estimates. The dimensions are equal to nlambda2, nlambda1 and the number of coefficients, respectively. It belongs to the object of class "pawls.grid" only.

ws

a 3-dimension numeric array containing the weight estimates. The dimensions are equal to nlambda2, nlambda1 and the number of observations, respectively. It belongs to the object of class "pawls.grid" only.

raw.bic

a numeric matrix with nlambda2 rows and nlambda1 columns giving the raw BIC value for each pair of tuning prameters. It belongs to the object of class "pawls.grid" only.

bic

a numeric matrix with nlambda2 rows and nlambda1 columns giving the BIC value for each pair of tuning prameters. It belongs to the object of class "pawls.grid" only.

Author(s)

Bin Luo, Xiaoli Gao

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
## generate data
library("mvtnorm")
set.seed(123)  # for reproducibility
n = 100 # number of observations
p = 8 # number of variables
beta = c(1, 2, 3, 0, 0, 0, 0, 0) # coefficients
sigma <- 0.5      # controls signal-to-noise ratio
epsilon <- 0.1    # contamination level
Sigma <- 0.5^t(sapply(1:p, function(i, j) abs(i-j), 1:p))
x <- rmvnorm(n, sigma=Sigma)    # predictor matrix
e <- rnorm(n)                   # error terms
i <- 1:ceiling(epsilon*n)       # observations to be contaminated
e[i] <- e[i] + 5                # vertical outliers
y <- c(x %*% beta + sigma * e)  # response
x[i,] <- x[i,] + 5              # bad leverage points

## fit pawls model over a find grid of tuning parameters
pawls(x,y)

## fit adaptive pawls model over a find grid of tuning parameters
pawls(x,y,lambda1.min = 0.001, lambda2.min = 0.05, initial = "PAWLS")

## fit adaptive pawls model using corss search over a grid of tuning parameters
pawls(x,y,lambda1.min = 0.001, lambda2.min = 0.05, initial = "PAWLS", search="cross")

pawls documentation built on May 2, 2019, 3:24 a.m.

Related to pawls in pawls...