Skip to content

detect discontinuities using Lasso based covariance test

License

Notifications You must be signed in to change notification settings

psdsam/lasso_break

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

lasso_break

Detect discontinuities using the Lasso-based covariance test as proposed in Backus and Peng (2018). If you use this package, please cite the our article below:

Backus, Matthew and Sida Peng (2018). "On Testing Continuity and the Detection of Failures," Working Paper.

The functions in this package are:

detectdisc: This is the main function for the test using a polynomial basis and 10-folded cross validation. The inputs are: an independent variable X, a dependent variable Y, and False Discovery Rate (FDR) control alpha. The outputs are the detected location of discontinuities and plot.

lassocovtest: This is the main function for the test. Users can customize the basis functions, cross-validation, the maxmium number of discontinuities allowed and support trimming within this function.

mylarsp: This is the function implementing the algorithm proposed in the paper including a moddified combination of

  1. LARs algorithm by Bradley Efron, Trevor Hastie, Iain Johnstone and Robert Tibshirani "Least Angle Regression" and code modified from Sung Soo Kim's work,
  2. Lasso covariance test by Richard Lockhart, Jonathan Taylor, Ryan J. Tibshirani, Robert Tibshirani "A significance test for the lasso"
  3. False Discovery Control by Max Grazier G'Sell, Stefan Wager, Alexandra Chouldechova and Robert Tibshirani in "Sequential selection procedures and false discovery rate control".

Example: This script implements our method with one simulation example and one real data example. The plots for both examples are displayed below. Simulation example with y = exp(x) + 5(x>-0.5) + 5(x>1)+\epsilon
alt text

Real data example from Lee (2008). "Randomized experiments from non-random selection in U.S. House elections" alt text

About

detect discontinuities using Lasso based covariance test

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages