criteria: Penalized criteria based on estimation of degrees of freedom

Description Usage Arguments Value Note References See Also Examples

Description

Produce a plot or send back the values of some penalized criteria accompanied with the vector(s) of parameters selected accordingly. The default behavior plots the BIC and the AIC (with respective factor log(n) and 2) yet the user can specify any penalty.

Usage

1
2
3
4
5
6
7
8
criteria(object, Y, penalty = setNames(c(2, log(length(Y))), c("AIC",
  "BIC")), sigma = NULL, log.scale = TRUE, xvar = "lambda",
  plot = TRUE)

## S4 method for signature 'blockSeg'
criteria(object, Y, penalty = setNames(c(2,
  log(length(Y))), c("AIC", "BIC")), sigma = NULL, log.scale = TRUE,
  xvar = "lambda", plot = TRUE)

Arguments

object

output of a fitting procedure of the blockseg package (e.g. blockSeg). Must be of class blockSeg.

Y

matrix of observations.

penalty

a vector with as many penalties a desired. The default contains the penalty corresponding to the AIC and the BIC (2 and log(n)). Setting the "names" attribute, as done in the default definition, leads to outputs which are easier to read.

sigma

scalar: an estimate of the residual variance. When available, it is plugged-in the criteria, which may be more relevant. If NULL (the default), it is estimated as usual (see details).

log.scale

logical; indicates if a log-scale should be used when xvar="lambda". Default is TRUE.

xvar

variable to plot on the X-axis: either "df" (the estimated degrees of freedom), "lambda" (lambda1 penalty level) or "fraction" (l1-norm of the coefficients). Default is set to "lambda".

plot

logical; indicates if the graph should be plotted on call. Default is TRUE.

Value

When plot is set to TRUE, an invisible ggplot2 object is returned, which can be plotted via the print method. On the other hand, a list with a two data frames containing the criteria and the chosen vector of parameters are returned.

Note

When sigma is provided, the criterion takes the form

RSS + penalty * df / n * sigma2

When it is unknown, it writes

n*log(RSS) + penalty * df

Estimation of the degrees of freedom (for the elastic-net, the LASSO and also bounded regression) are computed by applying and adapting the results of Tibshirani and Taylor (see references below).

References

Ryan Tibshirani and Jonathan Taylor. Degrees of freedom in lasso problems, Annals of Statistics, 40(2) 2012.

See Also

blockSeg.

Examples

1
2
3
4
5
6
n <- 100
K <- 5
mu <- suppressWarnings(matrix(rep(c(1,0),ceiling(K**2/2)), K,K))
Y <- rblockdata(n,mu,sigma=.5)$Y
res <- blockSeg(Y, 50)
criteria(res, Y, sigma=.5)

blockseg documentation built on May 2, 2019, 6:10 a.m.