This function computes the modified BIC(mBIC), given a specific solution.

RSAVS_Compute_BIC(
  y_vec,
  x_mat,
  beta_vec,
  mu_vec,
  loss_type,
  loss_param,
  phi,
  a,
  double_log_lik = TRUE
)

Arguments

y_vec

numerical vector of response. n = length(y_vec) is the number of observations.

x_mat

numerical matrix of covariates. p = ncol(x_mat) is the number of covariates.

beta_vec

numerical vector of covariate effects

mu_vec

numerical vector of subgroup effect(intercept term) for each observations

loss_type, loss_param

type and parameters of the loss function

  • loss_type = "L1": L-1 loss, no actual parameter is needed.

  • loss_type = "L2": L-2 loss, no actual parameter is needed.

  • loss_type = "Huber", Huber loss, and c = loss_param[0], where c is the parameter needed by huber loss. A popular choice is c = 1.345.

phi

a positive constant.

a

a scalar controlling the regression part of mBIC. If not provided, then the number of observation(n) is used.

double_log_lik

boolen, whether to use log logLik(double log likelihood) in the regression part of mBIC. Defaults to TRUE.

Value

the mBIC value.

Details

$$BIC = log(1 / a * sum(loss(y - mu - x * beta)) + |S| * Phi ,$$ where

  • mu is the intercept term of each observation. And the number of subgroups is K = length(unique(mu_vec)).

  • beta is the covariate effect vector. And the number of active covariates is Q = sum(beta_vec != 0).

  • the loss function is determined by loss_type and loss_param.

  • |S| is the complexity of the model and \(|S| = K + Q\).

  • Phi is a constant and Phi = phi * log(log(n + p)) * log(n) / n.

Note that in most cases, sum(loss_fun) corresponds to log likelihood.