calcBIC               package:stepNorm               R Documentation

_E_x_t_r_a_c_t _B_I_C _f_r_o_m _a _F_i_t_t_e_d _M_o_d_e_l

_D_e_s_c_r_i_p_t_i_o_n:

     Computes the Bayesian Information Criterion for a fitted
     parametric model.

_U_s_a_g_e:

     calcBIC(fit, subset=TRUE, scale = 0, enp, loss.fun = square)

_A_r_g_u_m_e_n_t_s:

     fit: fitted model; see details below

  subset: A "logical" or "numeric" vector indicating the subset of
          points used to compute the fitted model.

   scale: optional numeric specifying the scale parameter of the model;
          see 'scale' in 'step'.

     enp: equivalent number of parameters in the fitted model. If
          missing, the 'enp' component from fit will be used.

loss.fun: the loss function used to calculate deviance; the default
          uses the squared deviation from the fitted  values; one could
          also use abosulate deviations ('abs').

_D_e_t_a_i_l_s:

     The argument 'fit' can be an object of class 'marrayFit', in which
     case the 'residuals' component from the 'marrayFit' object will be
     extracted to calculate the deviance; the user can also pass in a
     numeric vector, in which case it will be interpreted as the
     residuals and the user needs to specify the argument 'enp'.

     The criterion used is

                      BIC = -2*log{L} + k * enp,

     where L is the likelihood and 'enp' the equivalent number of
     parameters of 'fit'. For linear models (as in 'marrayFit'),
     -2log{L} is computed from the deviance.

     'k = log(n)' corresponds to the BIC and is the penalty for the
     number of parameters.

_V_a_l_u_e:

     A numeric vector of length 4, giving 

     Dev: the deviance of the 'fit'.

     enp: the equivalent number of parameters of the 'fit'.

 penalty: the penalty for number of parameters.

Criterion: the Akaike Information Criterion for 'fit'.

_A_u_t_h_o_r(_s):

     Yuanyuan Xiao, yxiao@itsa.ucsf.edu, 
      Jean Yee Hwa Yang, jean@biostat.ucsf.edu

_S_e_e _A_l_s_o:

     'AIC', 'deviance', 'calcAIC'.

_E_x_a_m_p_l_e_s:

     ## load in swirl data
     data(swirl)

     ## fit a model
     fit <- fitWithin(fun="medfit")
     ## res is an object of class marrayFit
     res <- fit(swirl[,1])

     ## calculate BIC
     calcBIC(res)
     ## or could pass in the residual vector, but then argument "enp" needs to be specified
     calcBIC(res$residual, enp=1) 

