Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [deviance]

Deviance is twice the difference between the maximum achievable log likelihood and that attained under the fitted model.

0
votes
0answers
17 views

Obtain expression for scaled deviance

I have the following density function and I'm trying to calculate scaled deviance: $$ f(y) = \sqrt{\lambda/2\pi y^3}\exp(-{{\lambda(y-\mu)^2}\over{2\mu^2y}}) $$ I converted this into the exponential ...
1
vote
0answers
24 views

How does one compare two nested quasibinomial GLMs?

Lets say I have two models: Model 1 and Model 2, both of which are used to fit a quasibinomial GLM on some 0/1 response data (that I believe has overdispersion, hence quasibinomial GLM instead of ...
0
votes
0answers
15 views

Is there a difference in finding p-value using likelihood ratio vs minimum deviance statistic?

I am trying to fit my data to a distribution and find the fit parameters and associated p-value. If I use the -2-log likelihood ratio, or G-test, vs the minimum deviance method, will I get different p-...
0
votes
0answers
17 views

Compartion of GLM models through log-likelihood, deviance and chi square

I'm studying GLM models in software R. I have a dataset with the follow distribution: age, sex, years of study (ys), road or hightway (usop), and claims. I'm adjusting my model to claimns where it is ...
0
votes
0answers
19 views

Deviance when y = 0

I am trying to compute deviance for the predictions of my dataset and I encounter quite a big problem here. Deviance is calculated as : $2 (\log(\mathrm{yTrue}) - \log(\mathrm{yPred}))$ where $\log$...
0
votes
0answers
6 views

Integral form of the deviance residual

Is there an integral form of the deviance residual? I've always seen the deviance residual written as $$ d_i = 2w_i\Big(y_i\big(\tilde{\theta}_i - \hat{\theta}_i\big) - \big(b(\tilde{\theta}_i) - b(\...
0
votes
0answers
16 views

Model Deviance lower than Residual Degree of Freedom

I am trying to calculate the Variance inflation factor (VIF) for a Generalized Additive Model (GAM). The GAM model contains both constant terms and splines. The VIF is defined as Deviance of model ...
0
votes
1answer
28 views

Formula for deviance residuals for Poisson model with identity link function?

I understand the deviance residuals $r_D$ for a Poisson GLM with log link function are given by $r_D = \mu_{ij} \log(\mu_{ij}/\hat{\mu}_{ij}) + (\hat{\mu}_{ij} - \mu_{ij})$ I was wondering though ...
1
vote
0answers
68 views

Interpreting Pearson and Deviance residual graphs

Using a generalised linear model and predicted probabilities, I have been able to plot the Pearson residuals and Deviance residuals. I did this in order to have goodness of fit measures for the model. ...
1
vote
0answers
145 views

Goodness-of-fit glm: Pearson's residuals or deviance residuals?

I want to evaluate the goodness-of-fit (or badness-of-fit) of a negative binomial glm. However, even here within CV, I've seen multiple different approaches for doing so. Some use the the residual ...
1
vote
0answers
312 views

R Calculate Deviance Residuals in a Logistic Regression [closed]

I am working on a project, where I want to build a function which performs a logistic regression but does not use the glm() function. I ran in a little bit of difficulties, when it comes to calculate ...
0
votes
0answers
72 views

How can i interpret my residual deviance and degrees of freedom?

Ive made a binomial GLM in r and my resid. deviance and df are rather high; Null deviance: 4396.2 on 3207 degrees of freedom Residual deviance: 3679.4 on 3205 degrees of freedom (4346 ...
0
votes
0answers
22 views

Calculating the deviance when performing a hypothesis test of a parameter in a linear regression model

I want to make sure I am using and calculating the deviance correctly when performing a hypothesis test of the significance of a parameter in a linear regression model. Suppose that I have two ...
3
votes
1answer
427 views

Deviance residuals in Poisson GLM

I am learning the concept of residuals in modelling. I performed a Poisson GLM for a 3x3 contingency table and I got the summary of the model. My question is: the deviance residual from the in-built ...
4
votes
0answers
76 views

What are the pros and cons of different metrics for evaluating a logistic regression model?

In the data science world, I have always evaluated the performance of logistic regression models simply using ROC/AUC. However recently, I've read from some traditional statistics source about some ...
0
votes
0answers
37 views

Calculating deviance on validation data

Using R, I'd like to compare three nested logistic models with a binary outcome: one with just the covariates, one with weak predictors, and one with what I think is a strong predictor. I'm using glm ...
0
votes
0answers
28 views

Logistc regression - changes in the deviance

I'm reading about the logistic regression and i came across a phrase that i can't understand. The sentence is as follows (from the book: Introductory Statistics with R, Peter Dalgaard): "Changes in ...
0
votes
1answer
557 views

Goodness of Fit for Poisson Regression using R

I am trying to determine how well a Poisson model fits my data using Residual Null and Saturated Deviances. The Y col is the # of pennies that landed in a cup and the cup column represents the size. ...
1
vote
1answer
239 views

GAM negative deviance explained for Poisson model fitted with REML

I am fitting time series of neuron spike data with a Poisson GAM. I am fitting it with the following call: ...
0
votes
1answer
56 views

residual deviance and interactions in quasi-poisson model and negative binomial model?

My data was over-dispersed (dispersion coefficient over 5), so i have fitted both the quasi-poisson model and the negative binomial model. I notice that the regression coefficients are almost the same,...
0
votes
1answer
534 views

interpretation of deviance in logistic model

In logistic regression model for binary data, If the residual deviance(2*(likelihood of saturated model-likelihood of my model)) is 56.728 with df=117, what can I say about the lack of fit of the ...
2
votes
1answer
67 views

Diference in AIC value and significance of a factor

I am selecting a GLM model from a large data set based on an optimal AIC (Akaike information criterion ) for a set of candidate models. There about ~50 categorical factors in my model, each with ...
4
votes
2answers
317 views

Deviances in H2O

does anyone know how exactly the Deviances (Poisson, Gamma, Tweedie) are computed in H2O? I cannot find the functions. For interpretation purposes I would like to know the calculations. Thank you!
1
vote
0answers
52 views

Can I interpret Deviance as a sort of distance?

I've been studying some GLM theory, and I ran into deviance recently. Seems like the deviance has properties similar to a metric. Namely: $ D(y, y)=0$ Non-negativity $D(y, \mu) \geq 0$ I hesitate ...
3
votes
1answer
2k views

GAM (mgcv): AIC vs Deviance Explained

This is my first post & I'm fairly new to GAMs; apologies. I ran a series of 16 generalized additive negative binomial models (gam, family=nb, mgcv package) with increasing complexity that ...
2
votes
1answer
32 views

Should I include variables of no interest in the models when performing analysis of deviance on logistic regression with multiple predictors?

I have the logistic regression model $$\text{logit}(\pi_i)=\beta_0+\beta_1x_1+\beta_2x_2+\beta_3x_3+\beta_4x_4+\beta_5x_5$$ when $x_5=x_3\times x_4$. I set $H_0:\beta_3=\beta_4=\beta_5=0$ and the ...
2
votes
0answers
235 views

Obtaining Residual Deviance from cv.glmnet in R

I'm wondering how to obtain the residual deviance from my selected logistic regression model (once lambda has been selected) so that I can compare this model with another model I'll make from dropping ...
1
vote
0answers
72 views

How to intuitively explain the maths behind overdispersion?

I understand that overdispersion indicates extra, unexplained variation in the response than would be expected based on the statistical model of choice. And that the residual deviance is a measure of ...
1
vote
0answers
37 views

Parameter inference using deviance in normal linear model

I' am reading An Introduction to Generalized Linear Models. The authors introduce using deviance and discuss how it can be used directly as a goodness of fit statistic in logistic regression and ...
2
votes
1answer
1k views

Null & Residual Deviance in GLM in R

For a GLM in R, is it correct to interpret that Higher the difference between NULL & RESIDUAL deviance, better is your model? If not, then how do i know if my model is good or bad (for GLM - ...
0
votes
1answer
49 views

resources for understanding deviance

Can you please recommend a book or another resource for learning more about deviance, at roughly undergraduate level? I'm aware there are many specific questions and answers about deviance on this ...
5
votes
2answers
791 views

Diagnostics for General Linear Models

Pearson residuals follow normal distribution. We plot them against predicted values to see if the model is good. Why would we plot deviance residuals against predicted values? Deviance residuals don'...
2
votes
1answer
519 views

Interpret deviance residual plot in poisson regression

Below is a deviance residual plot obtained from a poisson regression. Since deviance residuals is a form of standardized residuals, we do expect it to have a constant variance. However, when there ...
4
votes
1answer
225 views

Need for zero-inflated poisson even though model fits data?

Have run a glm with Poisson-distributed errors on count data with 6 treatments and control. The output shows Residual deviance is 96.5 on 91 degrees of freedom, and result of: ...
3
votes
0answers
48 views

For an adequate fit of GLM models [duplicate]

I am trying to understand how to test for the goodness of fit in GLM regression. I am using an example from the book Davison and Hinkley (1997). In R, they fit the ...
2
votes
0answers
191 views

Pearson $\chi^2$ residuals vs deviance

In a GLM, how should I interpret the difference between using sum of the model's Pearson residuals model's Deviance to assess the fit of my model? Is the former more "flexible" since I can estimate ...
2
votes
0answers
949 views

How is deviance residuals calculated when the deviance is negative?

I was calculating the deviance from a regression model that I fitted following the same idea from here Deviance. For a likelihood $p(y|\theta)$, we define the deviance as $$D(\theta)=-2\log p(y|\...
2
votes
0answers
842 views

Different estimates for over dispersion using Pearson or Deviance statistics in Poisson model

I have a question about what is the best way to estimate the amount of over dispersion in a Poisson model. I am unclear what to use as a measure for over/under dispersion as there seems to be a lack ...
4
votes
0answers
406 views

Why is RMSE inapropriate for Poisson distribution?

I want to build models to predict the number of car claims which follow a Poisson distribution (mean = 0.05). One model is a Poisson regression and another is a RandomForest and I want to compare the ...
1
vote
1answer
321 views

Negative global deviance in gamlss?

What does a negative global deviance in gamlss mean? From their book "Flexible Regression and Smoothing", draft is here: http://www.gamlss.org/wp-content/uploads/2015/07/...
2
votes
1answer
330 views

Residual deviance: Poisson versus Quasi Poisson

There are numerous posts that have explained residual deviance and parameter estimates for the quasi Poisson. But since there is no probability distribution pertaining to the quasi Poisson and hence ...
0
votes
0answers
75 views

Can deviance residuals from a Rayleigh distribution be negative?

I'm fitting a nonlinear dynamic model to some non-normally distributed data using maximum likelihood estimation. My working approach has been to assume my data is gamma distributed and do gamma ...
4
votes
0answers
53 views

Why is the $\chi^{2}$ approximation for deviance GLM $\sim \operatorname{Binomial}(n_{i},\pi_{i})$ not valid when $n_{i} = 1$?

I know from McCullagh & Nelder's text (p.118) that the $\chi^{2}$ approximation for deviance for the binomial family is based on a limiting operation in which $n$, the number of observations, is ...
3
votes
0answers
528 views

calculating R square for a logistic regression [duplicate]

can anyone help me with how to calculate R-squared for a logistic regression- How do I use the deviance for this Purpose ? Additionaly, the question in matlab: I am calculating a psychometric ...
3
votes
0answers
600 views

Poisson Deviance - How to Estimate the Optimal Nodes for a Decision Tree

The following is the formulation for how the GBM package in R calculates the loss function and terminal node estimates for gradient boosting with decision trees. My question is generally how are the ...
1
vote
0answers
121 views

Why is the deviance $\chi^{2}_{n-p}$ distributed?

Consider a GLM with vector of parameters $\boldsymbol{\beta}$, the maximum likelihood estimates of the non-saturated model (no. of parameters = $p < n$) is $\boldsymbol{\hat{\beta}}$ and the ...
1
vote
0answers
73 views

Is likelihood in the background of both, anova and AIC?

Trying to compare different statistical tests, in particular anova(model,test="Chisq") and AIC, I have read the nice discussion under Logistic regression: anova chi-...
1
vote
0answers
494 views

Difference between residual deviance in summary() and anova() of negative binomial model

I've been looking at analysis of deviance tables of negative binomial models in R using the anova() function and can't work out why the figures for residual ...
0
votes
0answers
89 views

I don't know how to calculate SS(A), SS(A|B), SS(A|A*B), SS(A*B|A,B), etc

I read gung's answer to "How to interpret type I, type II, and type III ANOVA and MANOVA?". Instead of messing with R I'd like to just create my own linear model in a spreadsheet. The problem is that ...
2
votes
2answers
634 views

What do the terms dispersion parameter - deviance - and variance of $y_i$ mean?

I am studying GLMs and I am struggling a bit with some of the concepts. I think mine is more of a theoretical issue. Basically I am a bit confused by the meaning of these three concepts: the variance ...