ebenmichael / augsynth

Augmented Synthetic Control Method
MIT License
147 stars 52 forks source link

Change ridge CV procedure to be more generalized #27

Closed sideye closed 4 years ago

sideye commented 4 years ago

Added a cv.R and a set of supporting cross-validation functions for more potentially more generalized CV usage in the future. Altered ridge CV to follow this format.

Previously, conducting CV w/ ridge worked as follows: fit_augsynth_internal -> fit_ridgeaug_formatted -> ... -> choose_lambda, then the result was returned back up the stack.

Now, conducting CV works as follows: fit_augsynth_internal -> cv_ridge -> fit_ridgeaug_formatted. Here, cv_ridge calls fit_ridgeaug_formatted during cross validation and after $$\lambda$$ is chosen to return the final model.

sideye commented 4 years ago

@ebenmichael something to do before merging: should we clean up ridge.R and remove ridge_lambda.R since some parts of that are now obsolete?