Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

summary.vsel

Summary statistics related to variable selection


Description

Summary statistics related to variable selection

Usage

## S3 method for class 'vsel'
summary(
  object,
  nterms_max = NULL,
  stats = "elpd",
  type = c("mean", "se"),
  deltas = FALSE,
  alpha = 0.32,
  baseline = NULL,
  ...
)

Arguments

object

The object returned by varsel or cv_varsel.

nterms_max

Maximum submodel size for which the statistics are calculated. For plot.vsel it must be at least 1.

stats

One or several strings determining which statistics to calculate. Available statistics are:

  • elpd: (Expected) sum of log predictive densities

  • mlpd: Mean log predictive density, that is, elpd divided by the number of datapoints.

  • mse: Mean squared error (gaussian family only)

  • rmse: Root mean squared error (gaussian family only)

  • acc/pctcorr: Classification accuracy (binomial family only)

  • auc: Area under the ROC curve (binomial family only)

Default is "elpd".

type

One or more items from 'mean', 'se', 'lower' and 'upper' indicating which of these to compute (mean, standard error, and lower and upper credible bounds). The credible bounds are determined so that 1-alpha percent of the mass falls between them.

deltas

If TRUE, the submodel statistics are estimated relative to the baseline model (see argument baseline) instead of estimating the actual values of the statistics. Defaults to FALSE.

alpha

A number indicating the desired coverage of the credible intervals. For example alpha=0.32 corresponds to 68% probability mass within the intervals, that is, one standard error intervals.

baseline

Either 'ref' or 'best' indicating whether the baseline is the reference model or the best submodel found. Default is 'ref' when the reference model exists, and 'best' otherwise.

...

Currently ignored.

Examples

if (requireNamespace('rstanarm', quietly=TRUE)) {
  ### Usage with stanreg objects
  n <- 30
  d <- 5
  x <- matrix(rnorm(n*d), nrow=n)
  y <- x[,1] + 0.5*rnorm(n)
  data <- data.frame(x,y)
  
  fit <- rstanarm::stan_glm(y ~ X1 + X2 + X3 + X4 + X5, gaussian(), data=data, chains=2, iter=500)
  vs <- cv_varsel(fit)
  plot(vs)
  
  # print out some stats
  summary(vs, stats=c('mse'), type = c('mean','se'))
}

projpred

Projection Predictive Feature Selection

v2.0.2
GPL-3
Authors
Juho Piironen [aut], Markus Paasiniemi [aut], Alejandro Catalina [cre, aut], Aki Vehtari [aut], Jonah Gabry [ctb], Marco Colombo [ctb], Paul-Christian Bürkner [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.