View source: R/pre_define_functions.r
RSAVS_Compute_BIC | R Documentation |
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
)
y_vec |
numerical vector of response. |
x_mat |
numerical matrix 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
|
phi |
a positive constant. |
a |
a scalar controlling the regression part of mBIC. If not provided, then the number of observation( |
double_log_lik |
boolen, whether to use log logLik(double log likelihood) in the regression part of mBIC. Defaults to |
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.
the mBIC value.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.