Bug 16898 - aic() of gaussian & Gamma family are inconsistent
Summary: aic() of gaussian & Gamma family are inconsistent
Status: UNCONFIRMED
Alias: None
Product: R
Classification: Unclassified
Component: Models (show other bugs)
Version: R 3.3.*
Hardware: All All
: P5 normal
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2016-05-07 20:19 UTC by Antoine Lizee
Modified: 2016-05-07 21:01 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Lizee 2016-05-07 20:19:47 UTC
`Gamma()$aic` and `gaussian()$aic` seem inconsistent as the first increases linearly with the sum of the prior weights of the model, while the other doesn't. 

Both of the behaviors seem justifiable (even though I'd prefer the second), but it seems desirable to be consistent, as many other functions (including `logLik()`) seem to rely on it as a proxy for the log likelihood of the model.
Comment 1 Antoine Lizee 2016-05-07 21:01:31 UTC
MIN REPEX, where we can see that the gaussian likelihood fails at being multiplied by two when the weights are doubled: 

glms <-list()

glms$g1 <- glm(data = USArrests, Assault ~ UrbanPop + Rape, weights = rep(1, nrow(USArrests)))
glms$g2 <- update(glms$g1, weights = rep(2, nrow(USArrests)))

glms$G1 <- update(glms$g1, family = Gamma("identity"))
glms$G2 <- update(glms$g2, family = Gamma("identity"))

sapply(glms, '[', "aic")