Description Usage Arguments Value Note References See Also Examples
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.
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)
|
object |
output of a fitting procedure of the blockseg
package (e.g. |
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 |
log.scale |
logical; indicates if a log-scale should be used
when |
xvar |
variable to plot on the X-axis: either |
plot |
logical; indicates if the graph should be plotted on
call. Default is |
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.
When sigma
is provided, the criterion takes the form
When it is unknown, it writes
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).
Ryan Tibshirani and Jonathan Taylor. Degrees of freedom in lasso problems, Annals of Statistics, 40(2) 2012.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.