preprocess_iqr_milp: Compute IQR estimator by preprocessing MILP

View source: R/preprocess_iqr_milp.R

preprocess_iqr_milpR Documentation

Compute IQR estimator by preprocessing MILP

Description

Fix the sign of outliers' residuals to solve the IQR MILP more quickly

Usage

preprocess_iqr_milp(
  Y,
  D,
  X,
  Z,
  Phi = linear_projection(D, X, Z),
  tau,
  M = NULL,
  TimeLimit = NULL,
  globalTimeLimit = Inf,
  prop_alpha_initial = 0.7,
  r = 1.25,
  show_iterations = FALSE,
  LogFileExt = ".log",
  ...
)

Arguments

Y

Dependent variable (vector of length n)

D

Endogenous variable (n by p_D matrix)

X

Exogenous variable (including constant vector) (n by p_X matrix)

Z

Instrumental variable (n by p_Z matrix)

Phi

Transformation of X and Z to be used in the program; defaults to the linear projection of D on X and Z (matrix with n rows)

tau

Quantile (number strictly between 0 and 1)

M

A large number that bounds the absolute value of the residuals (a positive number); defaults to 2 times the largest absolute residual from quantile regression of Y on X and D

TimeLimit

Maximum time (in seconds) spent on a linear program; defaults to heuristic (numeric)

globalTimeLimit

Maximum time (in seconds) spent on the entire preprocessing function; defaults to Inf (i.e., no time limit) (numeric) thus, 1 - prop_alpha_initial is the proportion of observations whose dual variables (i.e., sign of the residuals) are fixed at the start (number between 0 and 1)

prop_alpha_initial

Initial value of the bandwidth alpha;

r

Rate at which we increase the bandwidth (alpha) at every iteration (number greater than 1)

show_iterations

If TRUE, print the iteration number to the console; defaults to FALSE (boolean)

LogFileExt

Extension of Gurobi log file; If LogFileName is empty, then Gurobi log won't be saved and this argument will be ignored; defaults to "log" (string)

...

Arguments that will be passed to iqr_milp

Details

Obtain the residuals from a quantile regression of Y on D and X. Use these residuals to guide which ones are the outliers, and fix their dual variables. In particular, fix the sign of the dual variables associated with residuals whose magnitude is larger than the α-percentile of the absolute residuals. (Note that the initial value of α is given by prop_alpha_initial.) Then, solve the preprocessed MILP.

If the minimized objective of the preprocessed MILP is not 0, then too many dual variables have been fixed. So, relax the number of fixed dual variables by multiplying the bandwidth alpha by r. Note that r should be at least 1 to ensure we are relaxing our preprocessing constraints. We then solve the relaxed preprocessed MILP.

We repeatedly relax our preprocessing until the minimized objective is finally 0.

Value

A named list of

  1. final_fit: output of iqr_milp from the final iteration

  2. time: time elapsed for this function to run

  3. iteration: number of iterations before objective is 0

  4. O_neg: indices for residuals that are fixed to be negative by the final iteration

  5. O_pos: indices for residuals that are fixed to be positive by the final iteration


omkarakatta/ivqr documentation built on Aug. 20, 2022, 11:04 p.m.