I'm using GAMLSS to model a variable as normally distributed with mean and SD as linear functions of some parameters. Sometimes GAMLSS gives me negative global deviances, but in my limited understanding, a normal distribution can't have a negative deviance as the deviance is equivalent to the squared error. Should I be worried? I've done some searching and found that negative deviances can happen for some distributions, but nobody seems to explicitly mention the normal distribution.
1 Answer
You can simulate some data to see what happens in a simple case:
n <- 10
x <- 1:n
set.seed(1234)
y <- 0.1 + 0.2 * x + rnorm(n, mean = 0, sd = 0.2)
library(gamlss)
model <- gamlss(y ~ x, family = NO)
summary(x)
The global deviance reported by R is negative, the reason for this being the fact that the variability of the y observations about the fitted regression line is small.
If you increase the amount of this variability, the global deviance will become positive:
n <- 10
x <- 1:n
set.seed(1234)
y <- 0.1 + 0.2 * x + rnorm(n, mean = 0, sd = 2)
library(gamlss)
model <- gamlss(y ~ x, family = NO)
So it is possible to have a negative global deviance in this simple case if the model produces a low value for the residual sum of squares.
-
1$\begingroup$ Thanks Isabella, that reassures me that I'm not making some basic blunder. I'm still puzzled however about how normal deviance can be negative at all. $\endgroup$ Jun 15, 2020 at 9:50
-
$\begingroup$ For the example I gave you, the global (fitted) deviance is defined as $n[log(2\pi * RSS/n) - 1]$, which can be shown to be negative if RSS is "small". This is how I was able to come up with an example where the residual sum of squares (RSS) is "small". See section 2.2.2 Testing between models of gamlss.com/wp-content/uploads/2013/01/book-2010-Athens1.pdf. $\endgroup$ Jun 15, 2020 at 14:44