Questions tagged [generalized-additive-model]
The generalized-additive-model tag has no usage guidance.
768
questions
0
votes
0
answers
10
views
Determine how likely a combination of two counts is compared to null models for both counts
I have two zero-adjusted negative binomial regression models fitted via gamlss not necessarily using the same covariates but at paired locations.
...
3
votes
1
answer
68
views
GAM model warning message: step failure in theta estimation
When running and gam model and this warning message pops up, what does this mean and what is advised? A simple increase in knots (even by 1) seems to remove this warning message.
"Warning message:...
2
votes
1
answer
47
views
Estimating separate smooths for a factor with hundreds of levels using GAMs
I am fitting a smooth-factor interaction term to a longitudinal microbiome abundance data set using GAMs.
...
2
votes
1
answer
71
views
How to obtain local time slope from GAM model
I have a model where I try to model the linear trend in my response over time
The trend may vary by elevation and location
As far as I understood the mgcv package ...
2
votes
0
answers
87
views
GAM interactions to predict deaths (with measurement error) from weather with distributed lag
I am trying to model the effect of heat (in particular of its constituent components air temperature, humidity, solar radiation and wind speed) on daily number of deaths using a generalized additive ...
3
votes
1
answer
91
views
Purpose for the conditions of Link Function
I am studying GLM at the moment and have a few questions regarding link functions.
Why are the conditions of the link function to be smooth monotonic function? What properties are preserved by having ...
0
votes
0
answers
31
views
understand and define complex spatial GAM structure
I want to use Generalized Additive Models (mgcv) to model a continuous variable over space and time.
I have say 3000 locations around the globe. Each location has an unevenly spaced time series of my ...
1
vote
1
answer
34
views
How to find difference in means at particular points in a by-factor GAMM?
This is a bit long but I wanted to give enough photos and code to explain what I'm doing and the issues I'm having. The main question is in the last paragraph.
I'm examining differences in male and ...
0
votes
0
answers
30
views
How to partition effects of variables and interactions in a GAM?
When using generalized additive models, can you partition the effects of variables and interactions?
Here is an example:
...
0
votes
0
answers
31
views
Binomial mgcv::GAM with different behavioral states - how to interpret results
I'm trying to understand whether I have diel patterns of behavioral states of sampled animals. Per hour, each animal is assigned one of three states based on how much time it's spending in each state: ...
1
vote
2
answers
52
views
GAM: statistically comparing fit when changing covariates in gratia (R)
I am using gratia to fit a gam model such as:
formula = as.formula(paste(Region, "~
s(date, k=20) + ID"))
I ...
0
votes
1
answer
53
views
GAM: Confidence interval for the covariates in gratia (R)
I am using gratia to fit a gam model such as:
formula = as.formula(paste(Region, "~ s(date, k=20) + ID"))
you can extract the CI of Region using:
...
1
vote
2
answers
46
views
How to multiply two models together in R?
I am constructing a two-stage GAM to model capture rate across my study site while accounting for zero inflation.
...
0
votes
0
answers
7
views
Options for two-stage GAM univariate model selection when AICc values <2Δ
I am constructing a two-stage GAM (stage 1 presence/absence with binomial and logit link, stage 2 abundance with poisson and log link) to model capture rate across my study site. As this is a pilot ...
0
votes
2
answers
46
views
Do you absolutely need a basis type "bs=" in a GAM model?
Under what circumstances would you NOT NEED to assign a basis (ex. basis="cr") type in a GAM model? For a simple model, to see what the effect of one environmental variable is on abundance, ...
1
vote
1
answer
49
views
AIC between glm and gam
What are the consequences of comparing the AIC from a logistic regression model (glm) to the AIC from a generalized additive model (gam with binomial link and REML)? Here's an example of two models, ...
2
votes
1
answer
32
views
What reasons beyond interpretability are there to use additive models over a complex, multivariate smoother?
Let's adopt for the second the notation from the R package mgcv.
...
4
votes
2
answers
67
views
Determining spline basis dimension using Wood's statistical test
In Simon Wood's book Generalized Additive Models (2nd ed.) on page 243, he describes the following procedure for checking that the basis dimension is too small:
Fortunately informal checking that the ...
0
votes
1
answer
29
views
How to use General Additive Model to impute missing data?
I am new to GAMs and R.
I have a long lists of time series of different lengths. Many of them are incomplete.
I have fitted a GAM and use the predict.gam function(mgcv package in R) to each time ...
4
votes
0
answers
49
views
PCA versus mixed effects model: Incorporating relationship between loadings?
I have species abundances with associations between environmental variables. I realize the RDA will only be able to tell you the strength of the relationship of all the species abundances with the ...
2
votes
1
answer
55
views
How to interpret threshold value not intersecting with smooth in ordered GAM?
My model consists of an ordered factor with four levels as the response variable and a continuous predictor.
mod <- gam(lev ~ s(pred), family = ocat(R = 4))
The ...
0
votes
1
answer
40
views
Prophet trend model
Can someone help me understand how Prophet automatically detects the change points in its piecewise linear trend model?
Please check page 10 of Prophet paper (Forecasting at Scale: https://peerj.com/...
0
votes
0
answers
44
views
GAMs with multiple time series predictors
I have a binomial classification (yes/no) made on about 100 words. For each word, I can compute several time series (fo, intensity, etc.). I’m finding difficult to model (using GAMs) the outcome, ...
1
vote
0
answers
43
views
GAM with year effect: fixed effects vs random effect, and mgcv:gam(~ s(bs='re') vs gamm4()
I'm trying to identify temporal effects on different response variables (examined in separate models) from data that may have underlaying seasonality and was collected during multiple years (a few ...
0
votes
0
answers
46
views
Paths to optimal K for GAM model selection
Let's say I have 10 different model combinations to compare via AIC for one year. There are 3 years of data, roughly 200-400 observations each year. For covariates, 2-3 of 5 appear to require tweaking ...
0
votes
1
answer
29
views
GAM - setting K-values before or after testing the different models
I'm working with GAM and I'm testing different models with and without certain variables, and I need to set k-values for the different smoothers. Do I need to use the exact same k-values prior to ...
0
votes
1
answer
66
views
Back transform predict.gam() from nb link log model run?
I have model with 1 covariate. I would like to run y values from gam in another model. I used nb(log=link) in gam model. Because I used nb and link log in gam, do I need to back transform to use ...
0
votes
1
answer
42
views
Residual bootstrap using a GAM model with two input variables
I've got a GAM model that is in the form of
$$Y=f(x_1)+f(x_2)$$
and I would like to perform a residual bootstrap with replacement. Is there any good place where I can see a coded example that does ...
0
votes
1
answer
70
views
Seasonal patterns with a GAM with recording gaps at some sample sites
I'm trying to identify seasonal and diel patterns in multi-year data from different locations using a mgcv::gam. I have continuous data at one site and recording ...
0
votes
0
answers
26
views
GAM to remove image noise in time series
I got some satellite data for a region where cloud coverage may introduce some noise into my images. I have a time series of images taken at 1 month apart and my response is a variable that has a ...
1
vote
1
answer
67
views
What is a GAM; question about sklearn's SplineTransformer
From my understanding, using basis-spline feature expansion/transformation with fixed parameters (number and placement of knots, etc.), then feeding that into a linear/logistic regression is ...
0
votes
1
answer
66
views
Doubt about my GAM formula, is it the right model to use for my data?
I measured a physiological performance of a specie (n=16) at 8 different temperatures, the same animal was used for each temperature and are identified by their "ID".
I want to model the non-...
0
votes
1
answer
96
views
How to interpret concurvity and wiggliness induced by low or high K knots in GAM models
Two questions: 1. Concurvity for factors =1, is this normal? 2. How do you interpret a partial effect when the effect is linear and lines for confidence intervals are pinched at 0?
Is it okay for ...
0
votes
1
answer
26
views
gamlasso from plsmselect package returns null for lasso
I was fitting a generalized additive model (GAM) with LASSO penalty to my data using gamlasso, as in the following (here I use simulated data, but the idea is ...
3
votes
4
answers
110
views
GAM with non-normal noise
I am starting to work with GAM models, and I am trying to figure out the consequences of having non-normal noise. Consider the following example (just note that ...
0
votes
0
answers
27
views
How to make predictions using PyGAM trained model parameters in a different ecosystem
I need to use a PyGAM already trained model, for a classification problem, in a different environment (JavaScript).
How can I use the coefficients of trained smoothing functions for making the ...
1
vote
1
answer
136
views
Is my GAM modeling longitudinal change appropriately?
My data includes the following:
Y which is a physiological measure
Age continuous
Gender ...
1
vote
1
answer
34
views
view default chosen k in mgcv's gam()
If using the default k in a smooth, e.g.
gam(y ~ s(age), data=dat, family=binomial)
how can I see which ...
0
votes
1
answer
23
views
Missing Data with Splines
I am modeling data with a gamma response. Two continuous variables in my data set are nonlinear and have a large number of nulls. One option I see is to bin/discretize the variables where the nulls ...
0
votes
2
answers
51
views
generalized additive model with proportion independent variable
I'm using GAM to model a potentially non-linear relationship between two variables (with some controls variables included) in mgcv. My main independent variable is a proportion (without 0's or 1's) ...
2
votes
1
answer
102
views
What to do when GAMM is linear?
I have the following gamm4 output:
This is longitudinal data modeled as:
...
3
votes
1
answer
141
views
How to interpret non-signicant intercept but significant smooth terms with GAM in R?
I have the following gam model:
...
0
votes
2
answers
64
views
GAM with Beta-Binomial family on very large data
I am trying to fit a GAM on (success) counts assuming they follow a beta-binomial distribution. Each data point has three values:
1- Number of trials (N)
2- Number of successes (n)
3- A covariate (p) ...
0
votes
0
answers
10
views
How to evaluate a GAM that predicts temperature over a certain extent with actual measured data?
I have a GAM that predicts the temperature on a relative scale (0 = coldest, 1= hottest value) of a raster extent. Secondly I have measured data from the same spatial extent that I can transform to ...
1
vote
1
answer
38
views
Spline model with a constant
I'm working on a reproduction of a model and I am running into some issues with the wording of the model and implementing it into R. The model that I am working with is an Additive AutoRegressive ...
0
votes
1
answer
145
views
GAM in R; an intercept term
I am dealing with GAM models. I don't understand the intercept term there. Consider the following simple model.
...
0
votes
0
answers
31
views
Interpreting data from a GAM that has data on log scale
I have a data set where I'm comparing territory sizes of animals of different age classes and populations. I use a GAM to fit a model as it seems to work very well when I fit the duration the animal ...
0
votes
0
answers
19
views
Properties of GAMs without intercept
Everyone and their dog knows it's bad practice to fit Linear Regression models without intercept. It forces regression hyperplane to go through the origin, which is a strong assumption that almost ...
0
votes
1
answer
10
views
Effect of missing segments on outcome variable in time series
Intuitively this is the case of something that exists but I don't know what it is called and so can't google it.
I have time series data in which some data are randomly missing. I suspect that, due to ...
0
votes
0
answers
166
views
plot.gam partial effects plot: is there another function to plot more than one variable?
The package description of plot.gam describes under Warning: "The function can not deal with smooths of more than 2 variables!" My gam model has a base model that includes habitat variables, ...