Skip to contents

Compute BIC for one or several fitted model objects for which a log-likelihood value can be obtained.

Usage

# S3 method for class 'splm'
BIC(object, ...)

# S3 method for class 'spautor'
BIC(object, ...)

# S3 method for class 'spglm'
BIC(object, ...)

# S3 method for class 'spgautor'
BIC(object, ...)

Arguments

object

A fitted model object from splm(), spautor(), spglm(), or spgautor() where estmethod is "ml" or "reml".

...

Optionally more fitted model objects.

Value

If just one object is provided, a numeric value with the corresponding BIC.

If multiple objects are provided, a data.frame with rows corresponding to the objects and columns representing the number of parameters estimated (df) and the BIC.

Details

When comparing models fit by maximum or restricted maximum likelihood, the smaller the BIC, the better the fit. The theory of BIC requires that the log-likelihood has been maximized, and hence, no BIC methods exist for models where estmethod is not "ml" or "reml". Additionally, BIC comparisons between "ml" and "reml" models are meaningless – comparisons should only be made within a set of models estimated using "ml" or a set of models estimated using "reml". BIC comparisons for "reml" must use the same fixed effects. To vary the covariance parameters and fixed effects simultaneously, use "ml".

BIC is defined as \(-2loglik + log(n)(estparams)\), where \(n\) is the sample size and \(estparams\) is the number of estimated parameters. For "ml", \(estparams\) is the number of estimated covariance parameters plus the number of estimated fixed effects. For "reml", \(estparams\) is the number of estimated covariance parameters.

Examples

spmod <- splm(z ~ water + tarp,
  data = caribou,
  spcov_type = "exponential", xcoord = x, ycoord = y
)
BIC(spmod)
#> [1] 4.353744