Computing BIC or QBIC

Share:

Description

Functions to compute the Bayesian information criterion (BIC) or a quasi-likelihood analogue (QBIC).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
useBIC(mod, return.K = FALSE, nobs = NULL, ...) 

## S3 method for class 'aov'
useBIC(mod, return.K = FALSE, nobs = NULL, ...) 

## S3 method for class 'betareg'
useBIC(mod, return.K = FALSE, nobs = NULL, ...) 

## S3 method for class 'clm'
useBIC(mod, return.K = FALSE, nobs = NULL, ...) 

## S3 method for class 'clmm'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)  

## S3 method for class 'coxme'
useBIC(mod, return.K = FALSE, nobs = NULL, ...) 

## S3 method for class 'coxph'
useBIC(mod, return.K = FALSE, nobs = NULL, ...) 

## S3 method for class 'fitdist'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)

## S3 method for class 'fitdistr'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)

## S3 method for class 'glm'
useBIC(mod, return.K = FALSE, nobs = NULL, c.hat = 1,
...)

## S3 method for class 'gls'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)

## S3 method for class 'gnls'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)

## S3 method for class 'hurdle'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)

## S3 method for class 'lavaan'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)

## S3 method for class 'lm'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)

## S3 method for class 'lme'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)

## S3 method for class 'lmekin'
useBIC(mod, return.K = FALSE, nobs = NULL, ...) 

## S3 method for class 'maxlikeFit'
useBIC(mod, return.K = FALSE, nobs = NULL, c.hat =
1, ...)

## S3 method for class 'mer'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)

## S3 method for class 'merMod'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)  

## S3 method for class 'multinom'
useBIC(mod, return.K = FALSE, nobs = NULL, c.hat = 1,
...)

## S3 method for class 'nlme'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)

## S3 method for class 'nls'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)

## S3 method for class 'polr'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)

## S3 method for class 'rlm'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)

## S3 method for class 'survreg'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)

## S3 method for class 'unmarkedFit'
useBIC(mod, return.K = FALSE, nobs = NULL, c.hat =
1, ...)

## S3 method for class 'vglm'
useBIC(mod, return.K = FALSE, nobs = NULL, c.hat = 1,
...)

## S3 method for class 'zeroinfl'
useBIC(mod, return.K = FALSE, nobs = NULL, ...)

Arguments

mod

an object of class aov, betareg, clm, clmm, clogit, coxme, coxph, fitdist, fitdistr, glm, gls, gnls, hurdle, lavaan, lm, lme, lmekin, maxlikeFit, mer, merMod, multinom, nlme, nls, polr, rlm, survreg, vglm, zeroinfl, and various unmarkedFit classes containing the output of a model.

return.K

logical. If FALSE, the function returns the information criterion specified. If TRUE, the function returns K (number of estimated parameters) for a given model.

nobs

this argument allows to specify a numeric value other than total sample size to compute the BIC (i.e., nobs defaults to total number of observations). This is relevant only for mixed models or various models of unmarkedFit classes where sample size is not straightforward. In such cases, one might use total number of observations or number of independent clusters (e.g., sites) as the value of nobs.

c.hat

value of overdispersion parameter (i.e., variance inflation factor) such as that obtained from c_hat. Note that values of c.hat different from 1 are only appropriate for binomial GLM's with trials > 1 (i.e., success/trial or cbind(success, failure) syntax), with Poisson GLM's, single-season occupancy models (MacKenzie et al. 2002), dynamic occupancy models (MacKenzie et al. 2003), or N-mixture models (Royle 2004, Dail and Madsen 2011). If c.hat > 1, useBIC will return the quasi-likelihood analogue of the information criteria requested and multiply the variance-covariance matrix of the estimates by this value (i.e., SE's are multiplied by sqrt(c.hat)). This option is not supported for generalized linear mixed models of the mer or merMod classes.

...

additional arguments passed to the function.

Details

useBIC computes the Bayesian information criterion (BIC, Schwarz 1978):

BIC = -2 * log-likelihood + K * log(n),

where the log-likelihood is the maximum log-likelihood of the model, K corresponds to the number of estimated parameters, and n corresponds to the sample size of the data set.

In the presence of overdispersion, a quasi-likelihood analogue of the BIC (QBIC) will be computed, as

QBIC = \frac{-2 * log-likelihood}{c-hat} + K * log(n),

where c-hat is the overdispersion parameter specified by the user with the argument c.hat. Note that BIC or QBIC values are meaningful to select among gls or lme models fit by maximum likelihood. BIC or QBIC based on REML are valid to select among different models that only differ in their random effects (Pinheiro and Bates 2000).

Value

useBIC returns the BIC or the number of estimated parameters, depending on the values of the arguments.

Note

The actual (Q)BIC values are not really interesting in themselves, as they depend directly on the data, parameters estimated, and likelihood function. Furthermore, a single value does not tell much about model fit. Information criteria become relevant when compared to one another for a given data set and set of candidate models.

Author(s)

Marc J. Mazerolle

References

Burnham, K. P., Anderson, D. R. (2002) Model Selection and Multimodel Inference: a practical information-theoretic approach. Second edition. Springer: New York.

Dail, D., Madsen, L. (2011) Models for estimating abundance from repeated counts of an open population. Biometrics 67, 577–587.

MacKenzie, D. I., Nichols, J. D., Lachman, G. B., Droege, S., Royle, J. A., Langtimm, C. A. (2002) Estimating site occupancy rates when detection probabilities are less than one. Ecology 83, 2248–2255.

MacKenzie, D. I., Nichols, J. D., Hines, J. E., Knutson, M. G., Franklin, A. B. (2003) Estimating site occupancy, colonization, and local extinction when a species is detected imperfectly. Ecology 84, 2200–2207.

Pinheiro, J. C., Bates, D. M. (2000) Mixed-effect models in S and S-PLUS. Springer Verlag: New York.

Royle, J. A. (2004) N-mixture models for estimating population size from spatially replicated counts. Biometrics 60, 108–115.

Schwarz, G. (1978) Estimating the dimension of a model. Annals of Statistics 6, 461–464.

See Also

AICc, bictab, bictabCustom, useBICCustom

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
##cement data from Burnham and Anderson (2002, p. 101)
data(cement)
##run multiple regression - the global model in Table 3.2
glob.mod <- lm(y ~ x1 + x2 + x3 + x4, data = cement)

##compute BIC with full likelihood
useBIC(glob.mod, return.K = FALSE)

##compute BIC for mixed model on Orthodont data set in Pinheiro and
##Bates (2000)
## Not run: 
require(nlme)
m1 <- lme(distance ~ age, random = ~1 | Subject, data = Orthodont,
          method= "ML")
useBIC(m1, return.K = FALSE)

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.