# olasso_path: Fit a linear model with organic lasso In natural: Estimating the Error Variance in a High-Dimensional Linear Model

## Description

Calculate a solution path of the organic lasso estimate (of error standard deviation) with a list of tuning parameter values. In particular, this function solves the squared-lasso problems and returns the objective function values as estimates of the error variance: \tilde{σ}^2_{λ} = \min_{β} ||y - X β||_2^2 / n + 2 λ ||β||_1^2.

## Usage

 1 2 olasso_path(x, y, lambda = NULL, nlam = 100, flmin = 0.01, thresh = 1e-08, intercept = TRUE) 

## Arguments

 x An n by p design matrix. Each row is an observation of p features. y A response vector of size n. lambda A user specified list of tuning parameter. Default to be NULL, and the program will compute its own lambda path based on nlam and flmin. nlam The number of lambda values. Default value is 100. flmin The ratio of the smallest and the largest values in lambda. The largest value in lambda is usually the smallest value for which all coefficients are set to zero. Default to be 1e-2. thresh Threshold value for underlying optimization algorithm to claim convergence. Default to be 1e-8. intercept Indicator of whether intercept should be fitted. Default to be FALSE.

## Details

This package also includes the outputs of the naive and the degree-of-freedom adjusted estimates, in analogy to nlasso_path.

## Value

A list object containing:

n and p:

The dimension of the problem.

lambda:

The path of tuning parameter used.

a0:

Estimate of intercept. A vector of length nlam.

beta:

Matrix of estimates of the regression coefficients, in the original scale. The matrix is of size p by nlam. The j-th column represents the estimate of coefficient corresponding to the j-th tuning parameter in lambda.

sig_obj_path:

Organic lasso estimates of the error standard deviation. A vector of length nlam.

sig_naive:

Naive estimate of the error standard deviation based on the squared-lasso regression. A vector of length nlam.

sig_df:

Degree-of-freedom adjusted estimate of the error standard deviation, based on the squared-lasso regression. A vector of length nlam.

type:

whether the output is of a natural or an organic lasso.

olasso, olasso_cv
 1 2 3 set.seed(123) sim <- make_sparse_model(n = 50, p = 200, alpha = 0.6, rho = 0.6, snr = 2, nsim = 1) ol_path <- olasso_path(x = sim$x, y = sim$y[, 1])