Quantcast

one more piece of info on AIC

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

one more piece of info on AIC

mark leeds
just one other thing about the AIC issue:

there is a line in glm.fit which is the following:

aic = aic(y, n, mu, weights, dev) + 2 * rank

but I couldn't find the function aic so I couldn't investigate further. It
looks suspicious though because it seems to me like
it should be

aic =  -2*likelihood + 2 * rank

if anyone could help me find the aic function it's appreciated.

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: one more piece of info on AIC

Peter Ehlers
On 2012-05-31 07:52, Mark Leeds wrote:

> just one other thing about the AIC issue:
>
> there is a line in glm.fit which is the following:
>
> aic = aic(y, n, mu, weights, dev) + 2 * rank
>
> but I couldn't find the function aic so I couldn't investigate further. It
> looks suspicious though because it seems to me like
> it should be
>
> aic =  -2*likelihood + 2 * rank
>
> if anyone could help me find the aic function it's appreciated.

Have a look at ?family to see that the family object used
in glm.fit() is a list most of whose elements are functions.
The code in glm.fit() has a few lines extracting those functions,
one of which is aic(). The 'gf <- Gamma()' example on the help
page for family is informative as is the annotated code for
glm.fit in the sources.

Peter Ehlers
--

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: one more piece of info on AIC

Rolf Turner-3
In reply to this post by mark leeds
On 01/06/12 02:52, Mark Leeds wrote:

> just one other thing about the AIC issue:
>
> there is a line in glm.fit which is the following:
>
> aic = aic(y, n, mu, weights, dev) + 2 * rank
>
> but I couldn't find the function aic so I couldn't investigate further. It
> looks suspicious though because it seems to me like
> it should be
>
> aic =  -2*likelihood + 2 * rank
>
> if anyone could help me find the aic function it's appreciated.

Dear Mark,

The aic() function depends on the family that you are using.

E.g.:

     binomial()$aic
     gaussian()$aic

     cheers,

         Rolf

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Loading...