# lamvec: returns a vector of values of lambda for given value of gamma In JPEN: Covariance and Inverse Covariance Matrix Estimation Using Joint Penalty

## Description

returns 10 values of lambda for each gamma.

## Usage

 `1` ```lamvec(c, gam, p) ```

## Arguments

 `c` c is absolute maximum of off-diagonal entries of sample covariance matrix. `gam` gamma is a non-negative constant. `p` p is number of rows/columns of matrix.

## Details

The lamvec function retuns a 10 values of lambda for each value of gamma. A larger value of lambda yields sparse estimate but need not be positive definite, however at least one combination of (lambda, gamma) will yield a positive definite solution. If two different combination of (lambda, gamma) yeilds same cross validation error, a larger values of lambda will be selected which results in more sparse solution.

## Value

A vector of values of lambda for each combination of gama. By choosing c as the maximum of off-diagonal elements of sample covariance matrix, the largest value of lambda yields an estimate which diagonal matrix with elements proportional to the diagonal elements of sample covariance matrix.

## Author(s)

Ashwini Maurya, Email: mauryaas@msu.edu

## References

A Well Conditioned and Sparse Estimate of Covariance and Inverse Covariance Matrix Using Joint Penalty. Submitted. http://arxiv.org/pdf/1412.7907v2.pdf

 ```1 2 3 4 5 6``` ```p=10;n=100;Sig=diag(p); y=rmvnorm(n,mean=rep(0,p),sigma=Sig); gam=c(0.5); S=var(y); c=max(abs(S[row(S)!=col(S)])); lambda=lamvec(c,gam,p); ```