# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.regression.linear.lasso

## Class ConstrainedLASSObyLARS

• java.lang.Object
• com.numericalmethod.suanshu.stats.regression.linear.lasso.ConstrainedLASSObyLARS
• All Implemented Interfaces:
LinearModel

public class ConstrainedLASSObyLARS
extends Object
implements LinearModel
This class solves the constrained form of LASSO by modified least angle regression (LARS) and linear interpolation: $\min_w \left \{ \left \| Xw - y \right \|_2^2 \right \}\) subject to $$\left \| w \right \|_1 \leq t$ See Also: • B. Efron et. al, "Least Angle Regression," The Annals of Statistics, Volume: 32(2), 407 - 499, 2004. • T. Hastie, R. Tibshirani and J. Friedman, "The Elements of Statistical Learning: Data Mining, Inference, and Prediction (Second Edition)," New York, Springer-Verlag, 2009. • Wikipedia: LASSO method • ### Constructor Summary Constructors Constructor and Description ConstrainedLASSObyLARS(ConstrainedLASSOProblem problem) Solves a constrained LASSO problem by modified least angle regression (LARS) and linear interpolation. ConstrainedLASSObyLARS(ConstrainedLASSOProblem problem, boolean demeaned, boolean normalized, double epsilon, int maxIterations) Solves a constrained LASSO problem by modified least angle regression (LARS) and linear interpolation. • ### Method Summary All Methods Modifier and Type Method and Description LMBeta beta() Gets \(\hat{\beta}$$ and statistics.
double Ey(Vector x)
Computes the expectation $$E(y(x))$$ given an input.
LMResiduals residuals()
Gets the residual analysis of an OLS regression.
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### ConstrainedLASSObyLARS

public ConstrainedLASSObyLARS(ConstrainedLASSOProblem problem,
boolean demeaned,
boolean normalized,
double epsilon,
int maxIterations)
Solves a constrained LASSO problem by modified least angle regression (LARS) and linear interpolation.
Parameters:
problem - a constrained LASSO problem
demeaned - an indicator of whether an intercept is included in the model
normalized - an indicator of whether the predictors are first normalized to have unit L2 norm
epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
maxIterations - the maximum number of iterations
• #### ConstrainedLASSObyLARS

public ConstrainedLASSObyLARS(ConstrainedLASSOProblem problem)
Solves a constrained LASSO problem by modified least angle regression (LARS) and linear interpolation.
Parameters:
problem - a constrained LASSO problem
• ### Method Detail

• #### Ey

public double Ey(Vector x)
Description copied from interface: LinearModel
Computes the expectation $$E(y(x))$$ given an input.
Specified by:
Ey in interface LinearModel
Parameters:
x - an input
Returns:
$$E(y(x))$$
• #### beta

public LMBeta beta()
Description copied from interface: LinearModel
Gets $$\hat{\beta}$$ and statistics.
Specified by:
beta in interface LinearModel
Returns:
$$\hat{\beta}$$ and statistics
• #### residuals

public LMResiduals residuals()
Description copied from interface: LinearModel
Gets the residual analysis of an OLS regression.
Specified by:
residuals in interface LinearModel
Returns:
the residual analysis

Copyright © 2010-2018 Numerical Method Incorporation Limited. All Rights Reserved.