2

Despite my best Googling efforts, I can't find an answer to this simple question:

Q: Does a generalised additive model with a link identity function and a Gaussian distribution assume homoscedasticity?

Lyngbakr
  • 741
  • 1
  • 7
  • 16

1 Answers1

5

Yes, the model that you mention assumes the model errors are independent, identically distributed with mean 0 and variance $\sigma^2$ (i.e., it assumes homoscedasticity). If you fit your model with the gam function in the mgcv package, you can see that the model summary reports the estimated value of $\sigma^2$. For example:

library(mgcv)
set.seed(0)

n <- 20000
x <- (1:n)/n
set.seed(0)
e <- rnorm(n = length(x), mean = 0, sd = 0.15)
y <- 0.5 + 2*x + 3*x^2 + e


plot(x,y)

m <- gam(y ~ s(x), data=data.frame(x,y))

plot(m)

summary(m)

names(summary(m))

summary(m)$dispersion  # scale parameter reported by gam

#?summary.gam

0.15^2 # variance of errors used in simulation 

The estimated value of the standard deviation of the errors ($\sigma$) is usually referred to as the residual standard error. However, as explained by Gavin Simpson at How I can interpret GAM results?, the summary of the gam function reports the squared value of the residual standard error, which estimates the variance of the errors ($\sigma^2$).

Isabella Ghement
  • 18,164
  • 2
  • 22
  • 46
  • 1
    Fantastic – thanks, Isabella. You anticipated several follow up questions I had! – Lyngbakr Jul 30 '19 at 16:29
  • 1
    Those were the same questions that I had! – Isabella Ghement Jul 30 '19 at 16:31
  • 1
    See this link for references to other GAM-fitting packages in R: https://m-clark.github.io/generalized-additive-models/appendix.html. – Isabella Ghement Jul 30 '19 at 16:38
  • If you need to fit a GAM model with heteroscedastic errors, you can use the gamlss function from the gamlss package. This function allows you to model log(sigma) as a function of predictor variable(s), where sigma is the conditional standard deviation of the errors given the predictor(s). The effect of the predictor(s) on log(sigma) can be assumed linear or nonlinear. See http://www.stat.tugraz.at/friedl/GAMLSS/Practical-Graz.pdf for an example - specifically, Section 1.1.8 on page 14. – Isabella Ghement Jul 30 '19 at 18:00
  • 1
    You can also do the same heteroscedastic model in mgcv with the `gaulss()` family. – Gavin Simpson Aug 02 '19 at 16:34