function_table.md

A list of the useful functions in the package.

| function | parameters | usage | source code | |------:|:------|:------:|:----:| | lasso_solve |y, X, lambda, epsilon = .1 | a Solver for the Lasso problem using the coordinate descent algorithm. Returns a vector of betas. | see code | | elasticNet_solve | y, X, lambda, epsilon = .1| a Solver for the ElasticNet problem using the coordinate descent algorithm. Returns a vector of betas. | see code | | tune_lasso |lambda_max , step_lambda, ytrain, Xtrain, yvalid, Xvalid|Returns the optimal lambda for Lasso, given a training and a validation set | see code | | tune_EN |lambda_max , step_lambda, ytrain, Xtrain, yvalid, Xvalid| Returns the optimal lambda and alpha for ElasticNet, given a training and a validation set | see code | | cv_lasso | lambda_max, step_lambda, n_folds = 10, y, X, one_stderr_rule = TRUE| Finds the best lambda for Lasso using cross validation. | see code | | cv_EN | lambda_max, step_lambda, n_folds = 10, y, X, one_stderr_rule = TRUE| Finds the best lambda and alpha for Elastic Net using cross validation. | see code | | plot_cv_lasso | cv_results | Takes the output of cv_lasso and plots the MSE associated with each lambda. | see code | | plot_cv_EN| cv_results | Plot the result of cv_EN | see code | | predict | betas, new_data| Given a vector of betas for a model, returns the model's predictions for a new set of observations. | see code | | createData | betas, n, sigma_error, example_number | Creates simulated data for a given simulation setting (see more below) | see code |



vviers/DIYLassoElasticNet documentation built on May 30, 2019, 12:49 p.m.