sgd_qr {SGDinference}R Documentation

Averaged S-subGD Estimator in Linear Quantile Regression

Description

Compute the averaged S-subGD (stochastic subgradient) estimator for the coefficients in linear quantile regression.

Usage

sgd_qr(
  formula,
  data,
  gamma_0 = NULL,
  alpha = 0.501,
  burn = 1,
  bt_start = NULL,
  qt = 0.5,
  studentize = TRUE,
  no_studentize = 100L,
  intercept = TRUE,
  path = FALSE,
  path_index = c(1)
)

Arguments

formula

formula. The response is on the left of a ~ operator. The terms are on the right of a ~ operator, separated by a + operator.

data

an optional data frame containing variables in the model.

gamma_0

numeric. A tuning parameter for the learning rate (gamma_0 x t ^ alpha). Default is NULL and it is determined by the adaptive method in Lee et al. (2023).

alpha

numeric. A tuning parameter for the learning rate (gamma_0 x t ^ alpha). Default is 0.501.

burn

numeric. A tuning parameter for "burn-in" observations. We burn-in up to (burn-1) observations and use observations from (burn) for estimation. Default is 1, i.e. no burn-in.

bt_start

numeric. (p x 1) vector, excluding the intercept term. User-provided starting value. Default is NULL. Then, it is estimated by conquer.

qt

numeric. Quantile. Default is 0.5.

studentize

logical. Studentize regressors. Default is TRUE.

no_studentize

numeric. The number of observations to compute the mean and std error for studentization. Default is 100.

intercept

logical. Use the intercept term for regressors. Default is TRUE. If this option is TRUE, the first element of the parameter vector is the intercept term.

path

logical. The whole path of estimation results is out. Default is FALSE.

path_index

numeric. A vector of indices to print out the path. Default is 1.

Value

An object of class "sgdi", which is a list containing the following

coefficients

a vector of estimated parameter values

path_coefficients

The path of coefficients.

Note

The dimension of coefficients is (p+1) if intercept=TRUE or p otherwise.

Examples

n = 1e05
p = 5
bt0 = rep(5,p)
x = matrix(rnorm(n*(p-1)), n, (p-1))
y = cbind(1,x) %*% bt0 + rnorm(n)
my.dat = data.frame(y=y, x=x)
sgd.out = sgd_qr(y~., data=my.dat)

[Package SGDinference version 0.1.0 Index]