# Questions tagged [deviance]

Deviance is a measure of distance between two probability distributions. In the case of GLMs, (total) deviance is twice the difference in log-likelihood between the full model and the restricted model.

233 questions
Filter by
Sorted by
Tagged with
27 views

### Proportion deviance explained by a predictor in a GAM fitted using mgcv with 'select=TRUE' (variable selection using double penalty)

Objective: To calculate proportion deviance explained by a predictor. Approach: Following this post by Simon Wood, the deviance explained by a predictor x1 is the ...
• 21
1 vote
26 views

• 51
39 views

### Questions regarding the definition of the deviance in the context of GLMs

I've been self-studying GLMs and I have some questions regarding the deviance in the context of GLMs. In Generalized Additive Models An Introduction with R, the author defines the deviance of a model ...
• 21
15 views

### Comparing GLMs with different fitted distributions

I have a scenario where I need to compare some generalized liner models (with same link function, target variable, but not necessarily nested) with k fold cross validation, using a cost function to ...
1 vote
58 views

### Rel. contribution of each term to deviance explained (in GAM)

I have seen this and similar questions all over the place, but no really satisfying answers: How can we quantify the contribution that each term in a GAM (using mgcv package) adds to the total ...
81 views

### How Do I Calculate the Scaled Deviance of a GLM with Gamma(Exponential) Distributed Dependent Variable?

I'm fitting a generalized linear model to a theoretically exponentially distributed dataset. The exponential distribution has PDF $$f(y;\lambda) = \lambda e^{-\lambda y}$$ This question Deviance for ...
• 103
1 vote
89 views

### Manual variable selection in GAM model based in deviance explained

I'm fitting a generalized additive model (GAM) to predict bottlenecks in a manufacturing process of a company. They have data of the bottlenecks that occurs in their process of making hot steel rolls. ...
21 views

### Logistic Regression Pattern in Deviance Variance Across Variables

I fitted a Logistic Regression model for a Customer Churn dataset with the following results I tested this model with a validation set and calculated the ROC AUC score, which was approximately 0.85 – ...
• 21
134 views

360 views

### In Poisson models with an offset, should performance metrics (such as deviance) be calculated in terms of raw counts or counts per exposure?

For context, I need some metrics that can compare a standard Poisson regression (with population offset) to a random forest regressor with Poisson criterion. The test predictions for both methods are ...
• 143
1k views

### Is the F test in ANOVA a likelihood ratio or Wald's one?

I'm trying to figure out, if the F test in ANOVA is the Wald's test or LRT? I learned, that the LRT compare nested models and "assess" the reduction in residual variance. This would justify ...
1 vote
462 views

### Discrepancy in degrees of freedom from R svyglm vs glm

I fitted a Poisson model using svyglm in R. The null and residual deviances from the svyglm model are as expected. For the degrees of freedom however, I get confusing results. With a sample size of n=...
• 11
1 vote
123 views

### How to compare the goodness of fit between linear and logit? Why linear deviance is less than logit?

How can I evaluate which model - between linear and logit - determine the best fit to the data? The models use the same input variables and I thought that comparing the deviances was the proper choice ...
• 43
718 views

### How to implement logistic regression deviance from scratch

As a learning exercise, I'm trying to implement the deviance for logistic regression from scratch. I understand the deviance to be: $\mathcal{L}_S - \mathcal{L}_M$, where $\mathcal{L}_s$ is equal to ...
105 views

### Deviance of a larger model is much larger than the deviance of the reduced(nested) model

I am doing a logistic regression with 8 variables but for some reason the model with the second degree of interaction has a much larger deviance than the nested model without interaction. Because of ...
1 vote
255 views

### How is that possible that SAS and R can test for main and interaction effects for the GEE if it has no likelihood?

I was taught, that GEE, being not likelihood based, has no way to compare models. That we cannot assess the main and interaction effects the way we do with ordinary GLM, OLS, GLS, mixed models and so ...
• 91
1k views

### GLM tests involving deviance and likelihood ratios

I'm a little confused about the different common tests for GLMs. There is the null deviance, which is similar to a likelihood ratio for the difference between the saturated model and the model with ...
• 555
404 views

### Why is deviance $\neq -2\times$logLik for logistic regression in R?

Just tried to compute McFadden's $R^2$ from hand in R from a fitted logistic regression, but stumbled accross the problem that the reported deviance is not equal to -2 times the reported log-Liklihood:...
• 5,430
2k views

### Overfitting, but why is the training deviance dropping?

The test set values increase over iterations signaling overfitting, but why is the training set deviance continuing to drop at the same time? This seems to indicate to me that the training set is ...
• 47
1 vote
70 views

### Is deviance a relevant metric for non-linear (neural) model?

Is deviance a relevant metric for non-linear (e.g. neural network) models? $$D(y,\hat\mu)=2\left ( log((p(y|\hat\theta_{s})) - log(p(y|\hat\theta_{0})))) \right )$$ For example, when we model ...
• 111
482 views

### For Poisson GLMs, when does the residual deviance follow a chi square distribution?

According to Generalized Linear Models by McCullagh and Nelder (I am looking at the 2nd edition, 1999), the deviance function is defined as $$D(y; \hat{\pi}) = 2[l(\tilde{\pi}; y)- l(\hat{\pi}; y)]$$ ...
• 121
1 vote
353 views

### Interpretation of Multinomial Logistic Regression model fit in R

I have fitted a multinomial logistic regression model in R. The data has 35 independent variables and the dependent variable has 3 levels. I do not find information on how to interpret the outcome of ...
5k views

### What is null hypothesis in the deviance goodness of fit test for a GLM model?

To test the goodness of fit of a GLM model, we use the Deviance goodness of fit test (to compare the model with the saturated model). In many resource, they state that the null hypothesis is that &...
The deviance residual of a GLM model is defined to be: $2 (log L_{Saturated Model} - log L_{GLM Model})$ where Saturated model is the model that has as many parameter as the number of data points. As ...