gridsearch: Compute IQR objective given grid of coefficients on...

View source: R/gridsearch.R

gridsearchR Documentation

Compute IQR objective given grid of coefficients on endogeneous variables

Description

For each set of beta_D suggested by grid, compute the sum of the absolute values of beta_Z

Usage

gridsearch(grid, Y, X, D, Z, tau, update = round(nrow(grid)/20), ...)

Arguments

grid

Data frame with p_D columns where each row is a set of beta_D coefficients; Output of center_out_grid

Y

Dependent variable (vector of length n)

X

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

D

Endogenous variable (n by p_D matrix)

Z

Instrumental variable (n by p_Z matrix)

tau

Quantile of interest (numeric between 0 and 1)

update

Send progress after every update values of grid search; defaults ot round(nrow(grid)) / 20, i.e., 20 updates (numeric)

...

Arguments to be passed to quantreg::rq()

Details

This code is not run in parallel.

Value

A data frame of dimension nrow(grid) by p_D + p_Z + 1 where each row corresponds to one set of coordinate values on the grid, the corresponding values for the instrument coefficient, and the resulting IQR objective


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