Questions tagged [generalized-additive-model]

Generalized additive models (GAMs) are regressions that estimate nonlinear patterns in data. This tag should not be used with the glm tag unless the question explicitly deals with comparison of the GAMs with GLMs.

Generalized additive models (GAMs) essentially allow users to model curvilinear data in a manner more flexible than typical regression modeling. These regressions achieve this by fitting splines to data based on estimations from basis functions that approximate where the data is while penalizing overfitting common in techniques like LOESS. More information on these models can be found at this wiki page.

997 questions
9
votes
1 answer

Seasonal Data with GAMMs

I'm interested in modelling a time series of temperature data across several years. The data are on the level of hourly observations, so I have variables for year, month, day, and time. I found a great example of doing this by Gavin Simpson (found…
5
votes
1 answer

Is there a formal way to determine the minimum sample size required to build a GAM?

As a rule of thumb, the minimum suggested sample size for a linear model is at least 10 per parameter included in the model (Bolket et al., 2009). I know that in GAMs, different smooth terms can have different effective degrees of freedom (edf) and…
KO 88
  • 341
5
votes
3 answers

What is the acceptable level of concurvity?

I got the following concurvity values as a result of a GAM model. Are they considered high or low? I don't know what is the acceptable value.
5
votes
1 answer

Layman's explanation of basis dimension (k) in Generalized Additive Models (GAMs)

The basis dimension (k) in GAMs allows for great flexibility in curve fitting. In my application having a large enough k is necessary to ensure GAM fits are monotonic. k = 20 encompasses a larger function space than does k = 10, for example. The…
compbiostats
  • 1,557
3
votes
1 answer

Should I use Poisson or Gaussian family in GAM?

I would like to ask if I am right to use a Gaussian family in my GAM analysis. I have some count data of the number of animals captured per 100 traps, which is not normally distributed. Then I did a log transformation and the shape is better, but…
2
votes
1 answer

GAM - Splines at selected covariate values

I am trying to answer a biology question regarding the antibody kinetics with one or two major breakpoints at 21 days and three months. It is possible for me to use linear splines using GLM framework, but I am wondering if it is possible to do so in…
2
votes
1 answer

Autocorrelated residuals in GAM even with lagged variables or AR process

I'm using GAMs to model ozone as a predictor, and using time , temperature and another pollutant (poll) as covariates. I have 20 years hourly data (large dataset), but I'm using 2 periods of 10 years, since I aim to see how the interaction term…
2
votes
1 answer

Why trend between smooth plots (of GAM) and scatter plot is the opposite?

Below is an example using mtcars. par(mfrow=c(1,2)) plot(mtcars$disp,mtcars$mpg) plot(mtcars$hp,mtcars$mpg) library(mgcv) gam1 <- gam(mtcars$mpg ~ s(mtcars$disp) + s(mtcars$hp), family = Gamma) plot(gam1, page = 1) The strange thing is that if I…
T X
  • 1,027
2
votes
1 answer

Formula for additive terms?

If I use GAM, what is the formula for the estimated smoother $s$, i.e. if we have the model $$y \sim s(x)$$ using mgcv? I can plot the term of $s$, but that isn't really all that informative. I want the exact formula, so that I can relay it in my…
Kashkai
  • 41
2
votes
0 answers

extract specific regression equation from a GAM model?

Is it possible to extract the specific mathematical equation behind a best GAM model? A generalized example: If for example I'm interested in regressing y ~ s(w,k=A) + s(x,k=A) + s(z,k=A) and then predicting y based on the non-linear relationships…
2
votes
0 answers

Combine multiple GAM models

I have multiple GAM models (1000) done for my cross-validation. Now I would like to combine all of these models to an average GAM model, which would be the final model used for prediction. Is this possible and how could it be done? The GAMs are made…
mokukk
  • 21
1
vote
1 answer

GAM on values per cell in a grid cell

I am running a GAM model on grid-cell data at a 1Km spatial resolution ~89K cells. My response variable is species richness, and I use a tw() distribution as it works better than Poisson and nb. The predictor variables are 2 Dimensions of a PCA…
Jess
  • 11
1
vote
0 answers

case down-weighted to emulate equal presence and absences

In GAM-based logistic regression pseudo-absence data is necessary to fit the model with corresponent presence data. In many cases, pseudo-absence data are generated 10 times more than presence records in order to ensure sufficient landscape variety…
Xavier
  • 11
1
vote
0 answers

Estimate smooth-factor differences in a complex model

I'm using mgcv to fit a GAM model for two different decades in a large data set. After some previous analysis, I ended with a model that includes 3 different interactions, so it would be like: mod_period1 <- y ~ te(x1,x2) + te(x3,x4) +…
1
vote
0 answers

GAM: Modelling rate of change with non-linear interaction

I want to model the rate of change of Y as (ΔY=Yt-Yt-1) as a function of x1, x2. For that I'm using a GAM model with an interaction as following: mod <- gam (ΔY~te(x2,log(x1+1)), data=mydata) I'm interested in particular in the…
1
2