# ridgeParamEst: Estimation of the ridge parameter In mvabund: Statistical Methods for Analysing Multivariate Abundance Data

 ridgeParamEst R Documentation

## Estimation of the ridge parameter

### Description

Maximum likelihood estimation of the ridge parameter by cross-validation

### Usage

```ridgeParamEst(dat, X, weights = rep(1,times=nRows), refs,
tol=1.0e-010, only.ridge=FALSE,  doPlot=FALSE,
col="blue",type="l", ...)
```

### Arguments

 `dat` the data matrix. `X` the design matrix. `weights` weights on the cases of the design matrix. `refs` a vector specifying validation group membership. Default is to construct `refs` using a method that is a function of the sample size `N`: if `N<=20`, leave-one-out is used `refs=1:N`, if `N<=40`, 10-fold Cross Validation is used where group membership is chosen randomly but with equal size groups, otherwise 5-fold CV with random group memberships. `tol` the sensitivity in calculations near zero. `only.ridge` logical, whether only the ridge Parameters should be passed back or additionally the Cross Validation penalised likelihood. `doPlot` logical, whether a plot of -2logL vs a candidate for the ridge parameter should be drawn. `col` color of Plot symbols. `type` type of Plot symbols. `...` further plot arguments.

### Details

This function estimates the ridge parameter when applying ridge regularization to a sample correlation matrix of residuals. The ridge parameter is estimated to maximize the normal likelihood as estimated via cross validation (Warton 2008).

### Value

A list with the following component:

 `ridgeParameter` the estimated ridge parameter

If `only.ridge=FALSE` the returned list additionally contains the element:

 `minLL` the minimum of the negative log-likelihood

.

### Author(s)

David Warton <David.Warton@unsw.edu.au> and Ulrike Naumann.

### References

Warton D.I. (2008). Penalized normal likelihood and ridge regularization of correlation and covariance matrices. Journal of the American Statistical Association 103, 340-349.

`manylm`

### Examples

```data(spider)
spiddat <- mvabund(spider\$abund)
X <- as.matrix(spider\$x)

ridgeParamEst(dat = spiddat, X = model.matrix(spiddat~X))
```

mvabund documentation built on March 18, 2022, 7:25 p.m.