logLik.gam {mgcv} | R Documentation |

## Extract the log likelihood for a fitted GAM

### Description

Function to extract the log-likelihood for a fitted `gam`

model (note that the models are usually fitted by penalized likelihood maximization).

### Usage

logLik.gam(object,...)

### Arguments

`object` |
fitted model objects of class `gam` as produced by `gam()` . |

`...` |
un-used in this case |

### Details

Modification of `logLik.glm`

which corrects the degrees of
freedom for use with `gam`

objects.

The function is provided so that `AIC`

functions correctly with
`gam`

objects, and uses the appropriate degrees of freedom (accounting
for penalization). Note, when using `AIC`

for penalized models, that the
degrees of freedom are the effective degrees of freedom and not the number of
parameters, and the model maximizes the penalized likelihood, not the actual likelihood!

### Value

Standard `logLik`

object: see `logLik`

.

### WARNING

Note that the likelihood is evaluated at the maximum of
the penalized likelihood for most GAMs, rather than at the MLE.

### Author(s)

Simon N. Wood simon.wood@r-project.org based directly on `logLik.glm`

### See Also

`AIC`

[Package

*mgcv* version 1.2-3

Index]