 Vienne ja vienne-rejitujat ovat seuraavat, jotka ovat yksinkertaiset, joilla on useita GLMs. Laitetaan katsota, mitä vienne ja vienne-rejitujat ovat. Vienne-rejitujat ovat kalkkulat, joilla on koko ajan yksinkertaisuus ja vienne-rejitujat. Vienne-rejitujat ovat minua koko ajan yksinkertaisuus ja sitten saamme koko ajan. Vienne-rejitujat ovat yksinkertaisita, jotka ovat yksinkertaiset, erilaisia, koko ajan yksinkertaisuusta. Vienne-rejitujat ovat tässä, ja MCC se on ihan vienne-rejitujat, jolloin se saadaan koko ajan yksinkertaisuus. Vienne-rejitujat ovat minua koko ajan yksinkertaisuus ja vienne. Parallelun regresson analysointi on, että maximisaatinga lopulta on the same thing as minimizing the overall deviance, which is the sum of squares of residual, deviance residuals. So GLM estimation, maximum likelihood estimation, is equivalent to calculating the least squares of deviance residuals. So there is an interesting parallel. There are also some other interesting parallels that I will explain in the next few slides. When you do a GLM, you will get statistics about deviance residuals and the overall deviance as shown here. So we have residual statistics, these are about deviance residuals, and these model quality indices are about deviance, overall deviance of the model. Let's take a look at the residual statistics first. Residual statistics here give us the quartiles minimum, maximum and median of the residuals. The deviance residuals, if the model is correctly specified, so the distribution is correct and the linear prediction is correct, they are normally distributed in large samples. The deviance residual is also, or the square of deviance residual also quantifies how much each observation contributes to the actual likelihood value. So they can be used as influence statistics, similarly to residual in our square. So one way of doing diagnostics to GLMs is that when you have a large sample, you can check which observations have a large deviance residual and whether the deviance residuals are normally distributed or not. Then we have the overall model deviance here in the model quality indices. We have two deviances and the null deviance and the residual deviance and then we have a statistic called AIC. The null deviance is a deviance for a model with intercept only, so a model where none of the explanatory variables explain the dependent variable at all. So here we have 3970 degrees of freedom for the null deviance. Then the deviance for the estimated model is the residual deviance. We have 3916, so we lost one degree of freedom because we had one independent variable and this is the overall deviance, which is minus two times the log likelihood. So minus two times log, if we multiply this by minus half, then that's the value of the log likelihood that the computer actually minimizes when it estimates the model. Then AIC is similar to adjusted R-square so that it can be used for model comparison. So it penalizes the deviance for the complexity of the model. We subtract the number of parameters divided by two from the deviance that gives us AIC. AIC can be used for comparing two models that are not nested when they are fitted to the same data. The AIC itself, the value, whether it's large or not, it doesn't really have any interpretation. We can just use to compare AICs and if deviance is smaller, it means that the model explains the data better. That means that if AIC is smaller, then the model fits better. So we can use AIC for comparing which model we use. For example, if we have two models that have different sets of variables that are non-nested, then we could use AIC to compare which of those models is better for the day.