# Akaike information criterion

## Akaike information criterion :

Akaike information criterion, also known as AIC, is a statistical measure used to evaluate the quality of a model by comparing the goodness of fit of the model with the number of parameters in the model. The AIC is calculated by adding the residual sum of squares (RSS) and twice the number of parameters in the model. The AIC is often used in model selection, where the goal is to choose the model with the smallest AIC value.
A simple example of using AIC in model selection can be seen in linear regression. Suppose we have a dataset with two predictor variables, x1 and x2, and one response variable, y. We want to use linear regression to model the relationship between the predictor variables and the response variable. We can fit two different models: a model with only x1 as a predictor, and a model with both x1 and x2 as predictors.
For the model with only x1 as a predictor, the model can be represented as y = β0 + β1×1. For the model with both x1 and x2 as predictors, the model can be represented as y = β0 + β1×1 + β2×2.
In order to calculate the AIC for each model, we first need to calculate the residual sum of squares (RSS) for each model. The RSS is calculated by summing the squared differences between the observed y values and the predicted y values for each observation.
For the model with only x1 as a predictor, the RSS is calculated as: