How to calculate AIC in glmfit?

12 次查看(过去 30 天)
Please help me with this!
How to calculate AIC in glmfit? I use gamma and log as link function.
Thanks a lot!

采纳的回答

Shashank Prasanna
Shashank Prasanna 2014-7-14
It is recommended to use fitglm instead of the older glmfit. Depending on the release of MATLAB (> R2012a) you can use either of the two:
You can access AIC, BIC etc as follows:
load hospital
modelspec = 'Smoker ~ Age*Weight*Sex - Age:Weight:Sex';
mdl = fitglm(hospital,modelspec,'Distribution','binomial')
mdl.ModelCriterion
ans =
AIC: 137.141380948166
AICc: 138.358772252513
BIC: 155.377572250082
CAIC: 162.377572250082
  1 个评论
MURAT OKATAN
MURAT OKATAN 2021-4-26
Note, however, that fitglm computes the model criteria using mdl.NumCoefficients as the number of parameters estimated, and mdl.NumCoefficients does not account for the dispersion parameter of the Normal, Gamma and Inverse Gaussian distributions [1]. But, according to some studies [e.g. 2,3 and 4], the dispersion parameter needs to be counted among estimated parameters in computing the model criteria in GLMs that use those distributions.
[1] MATLAB Version: 9.7.0.1261785 (R2019b) Update 3.
[2] Clifford M. Hurvich, Chih-Ling Tsai, Regression and time series model selection in small samples, Biometrika, Volume 76, Issue 2, June 1989, Pages 297–307, https://doi.org/10.1093/biomet/76.2.297.
[3] Joseph E. Cavanaugh, Unifying the derivations for the Akaike and corrected Akaike information criteria, Statistics & Probability Letters, Volume 33, Issue 2, 1997, Pages 201-208, ISSN 0167-7152, https://doi.org/10.1016/S0167-7152(96)00128-9.
[4] Burnham, K.P. and Anderson, D.R. (2002) Model Selection and Inference: A Practical Information-Theoretic Approach. 2nd Edition, Springer-Verlag, New York. (e.g. p.95 Table 2.1)

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Analysis of Variance and Covariance 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by