1
$\begingroup$

I have a gamm that looks to be heavy tailed according to the qqplot so I'd like to account for this. According to this page things like scaled t distributions for heavy tailed data are only available for GAM or BAM.

enter image description here

Here's my model if it helps:

m1<-
  gamm(
    y ~ s(day_of_year, k = 100) + s(deaths, k = 100) +
      s(Month, bs = 'cc', k = 12) + indicator + Year,
    data = mydata,
    method = "REML",
    correlation = corAR1()
  )
$\endgroup$
3
  • $\begingroup$ You could use bam() and hand optimise the AR(1) parameter $\endgroup$ Commented Mar 11 at 16:38
  • $\begingroup$ Thank you, I came across this link cran.r-project.org/web/packages/itsadug/vignettes/acf.html which suggests I run a model without the autocorrelation and use that to supply the value of Rho to the model with autocorrelation. Is that what you mean by hand optimising? $\endgroup$
    – adkane
    Commented Mar 11 at 19:46
  • 1
    $\begingroup$ That's one way to do it; the other is to fit models over the range of rho values you want to try and see which gives the lowest REML score for example. $\endgroup$ Commented Mar 12 at 6:43

1 Answer 1

0
$\begingroup$

I followed Gavin Simpson's advice in the comments. I needed to use discrete = TRUE to fit the t distribution.

mgcv::bam(avg_compound ~ s(DayIndicator, k = 100) +s(Total_new_deaths, k=100) +
            batWeek, data=mydata, family = "scat",rho = .3, discrete=TRUE)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.