View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
LARS algorithm

5.0 | 1 rating Rate this file 19 Downloads (last 30 days) File Size: 1.44 MB File ID: #23186 Version: 1.0

LARS algorithm


Sung Soo Kim (view profile)


04 Mar 2009 (Updated )

Pure vanilla implementation of LARS algorithm.

| Watch this File

File Information

This is a pure vanilla implementation of LARS algorithm with LASSO modification. For more information about the algorithm follow the link. This document is included in the zip file (LeastAngle_2002.pdf).
There are many 'lars' implementation in the internet if you search. This is a relatively pure porting of the 'lars' package written by algorithm developer long time ago for R statistics language. Recent version by authors may have many changes. See for more information.
I commented equation number line by line in the codes so that you can follow the algorithm as you read the paper. You may start developing your own 'lars' implementation from this point. Test set includes Diabetes example used in the original paper (sorry, no plots for that). If you find any error, let me know. I'll appreciate it.

Caution: I've been using this file for more than 3 years, but I've never used 'forward stagewise' or 'pure lars'. I've been using only 'lars with lasso modification'. So I don't guarantee former two algorithms.

Just copy 4 files in the 'lars' folder to your path. Or add 'lars' folder to your Matlab path.

Read the 'test_lars.m' file. All files in the 'lars_tests' folder should be in the search path. It is written in the XTargets' MUnit format. But if you don't use MUnit, that's fine. Just copy and run codes in nested functions in that file.

See 'test_lars.m' file.

License: The original R-package written by algorithm developers is under GPL v2 or newer. So is this.


This file inspired Zero Sr1.

MATLAB release MATLAB 7.1.0 (R14SP3)
MATLAB Search Path
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
25 Jul 2014 Hong Jang

13 Oct 2011 Sung Soo Kim

The Matlab R2011a implemented a great function called 'lasso' in the Statistical Toolbox. If you have the Statistical Toolbox, use 'lasso'.

You may still use my function as a study purpose or when you don't have the statistical toolbox.

Comment only
31 Mar 2016 1.0


31 Mar 2016 1.0


Contact us