Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [gam]

Generalized additive model (GAM) is a generalized linear model (GLM) in which the response variable depends on unknown smooth functions of some predictor variables.

3
votes
0answers
32 views
+50

How can I incorporate a known measurement error per group into a GAM?

I am trying to investigate surface changes using a time series of 3D point clouds. Due to data volume, I am segmenting the point cloud in small (eg. 50cmx50cm) areas and for each compute a generalized ...
1
vote
1answer
20 views

Random effects in GAM

I'm modelling some biological function, outcome, in patients over 8 hours. Over time, I measure two additional covariates x and ...
2
votes
3answers
46 views

Problems interpreting GAM output

I have been advised to run General Additive Models to be able to describe trends in my data, my data being animal harvest numbers by year. I have done so, but have a problem with interpreting the ...
8
votes
2answers
166 views

Different ways of modelling interactions between continuous and categorical predictors in GAM

The following question builds on the discussion found on this page. Given a response variable y, a continuous explanatory variable ...
0
votes
1answer
22 views

Why the dependent variable as a time series in GAM should be log transformed?

I found in Section 3.1 of this paper (see ), the author used log(y) due to "the context of a concentration time series". A book (Hastie and Tibshirani, 1990) is cited, however I cannot get this book. ...
3
votes
1answer
783 views

Random effect in GAM (mgcv package)

I am using the mgcv package in R to model the ratio of damaged culture hectares by wild boar in each french department according to some environmental covariates. I used a using a Beta distribution ...
0
votes
0answers
23 views

Practically speaking, what do the three concurvity measures provided by the package mgcv mean?

I am using the R package mgcv to examine the association between asthma visits to the ER and air pollution. Most of my terms are parametric, with the exception of time, which is a smooth cubic ...
2
votes
1answer
56 views

Concurvity in additive modelling. Parametric term?

I am modelling a outcome in gam were two variables (x1 and x2) are continuous and the other four are factors. I have a suspicion that x1 and x2 might be collinear so I want to check that. As I ...
0
votes
1answer
20 views

What is the acceptable level of concurvity?

I got the following concurvity values as a result of a GAM model. ¿are they high or low? I don't know what is the acceptable value... Thanks, Karla .
3
votes
1answer
38 views

Hard in calculating predictor‘s Relative Importance for GAM?

Although there is no agreement upon "relative importance for predictors" with (even) linear models (one possible definition: lmg method), I would still want to know whether there are some acceptable ...
3
votes
1answer
14k views

additive and non-additive(multiplicative) interactions - soft question -

we use models with multiplicative interaction effects when relationship between independent variable and dependent variable are non-additive. My question is, Are all models with multiplicative ...
1
vote
0answers
21 views

How to measure the amount of confounding in tensor interaction in GAMs?

I am interested in fitting an additive model with tensor interaction terms. This construction is described in Wood (2006) and used in the mgcv ...
0
votes
1answer
28 views

How to plot mortality at age curve using lifespan data

I have a table with the lifespan of multiple individuals from a species and would like to use this data to plot a mortality rate curve, similar to that shown in figure 1 of this study:https://www....
2
votes
0answers
21 views

How do I use GAMs in instrumental variable analysis?

I have an outcome $Y$, a risk factor $X$, and an instrument $Z$. In a two-stage least squares (2SLS) setting, the first stage is $$ X=Z + \varepsilon $$ and the second stage uses predictions from ...
2
votes
1answer
181 views

Should I capitalize GAM, MARS and LOESS?

I have to mention GAM (generalized additive models), MARS (multivariate adaptive regression splines), and LOESS in an academic paper. I think GAM and MARS are capitalized in most cases, but not sure ...
0
votes
0answers
21 views

Step failure in theta estimation using bam() in mgcv

I am using ?bam in mgcv 1.8-24, and when I'm using the negative binomial family I sometimes get a warning that says: ...
2
votes
0answers
24 views

Which index is preferred in GAM, “R-sq” or “Deviance explained”?

I use mgcv package in R to build a Generalized Additive Model. When looking at results of (e.g., summary()), there are two ...
1
vote
0answers
35 views

How partial residuals in “plot.gam” are calculated?

Take mtcars as an example. I build a GAM model between mpg (dependent variable) and disp and ...
1
vote
1answer
31 views

Differences of GAMs and GLM

I'm currently looking at a dataset and have to create a model to predict outcomes for whose values are non-negative. I'm looking at using a GLM or GAM for my data though I'm unaware of what would work ...
1
vote
1answer
26 views

Why 2nd derivative is “squared” to represent wigglyness in GAM?

In David Miller's presentation (here, slide 21), he drew 1st derivative and 2nd derivative of a function. Then he said (slide 22) that grey part can is : $ \int (\frac{\partial ^{2}f(x)}{\partial x^{...
2
votes
1answer
66 views

Does GAM (Generalized Additive Model) have collinearity problem?

There is collinearity effect in linear regression methods. For example, this question is about collinear predictors in GLM. But GAMs are nonlinear, do we need to check the collinearity of independent ...
0
votes
1answer
27 views

mgcv::gam(). ANOVA decomposition of a factor-by-variable interaction

Suppose: y is a continuous response variable. z is a factor variable, and x is a continuous variable. For example, ...
1
vote
1answer
30 views
1
vote
1answer
111 views

Generalized Additive Model result interpretation

This is result from Generalized Additive Model. I am trying to look at the relationship between the number of deaths(dependent variable) and PM2.5 (independent variable) with lag effect. However, I ...
1
vote
1answer
53 views

Confidence Interval for non-smooth term in gam (mgcv)

I fitted a gam model in mgcv package and now want to get the confidence intervals for the non-smooth term. ...
1
vote
1answer
207 views

GAM negative deviance explained for Poisson model fitted with REML

I am fitting time series of neuron spike data with a Poisson GAM. I am fitting it with the following call: ...
2
votes
0answers
206 views

Model Comparison of GAMs using gamm4

I am using a GAM from package gamm4 in R to fit a varying coefficient model for longitudinal data. I have data consisting of ...
1
vote
0answers
24 views

Standarized coefficients of a general additive model GAM

I am using a GAM model to study the effects of time (in weeks) and quality parameters (qp1, qp2, qp3 and qp4) on a response variable. Since the effect of time is modelled best by a spline, I am using ...
0
votes
0answers
7 views

Does the parametric coefficient from GAMM compare patterns between groups over time, or just the means?

I have data consisting of the distance cats travelled each hour, collected over four or five days per cat. The cats were measured in different seasons and I want to know whether the activity of the ...
0
votes
1answer
242 views

checking multicollinearity with generalized additive model in R

I am trying to check multicollinearity with GAM using VIF in R. Should I use vif from the package car ? or Is it right way to check vif using vif.gam from package mgcv::helper:: ? It gives quite ...
0
votes
0answers
14 views

Model Deviance lower than Residual Degree of Freedom

I am trying to calculate the Variance inflation factor (VIF) for a Generalized Additive Model (GAM). The GAM model contains both constant terms and splines. The VIF is defined as Deviance of model ...
3
votes
1answer
190 views

Presence/Absence GAMM with penalized smoother convergence/completion problem, data set too large

I am having issues running a GAMM to determine presence/absence with a very large data set (9,000,000 rows x 13 cols) using GAM4 in R. I think the data set may be too large and is causing convergence/...
1
vote
0answers
27 views

bam() error: “reparameterization unstable for margin: not done”

In running a large GAM model of the form mgcv::bam(y ~ te(x, y, k = 100, bs = 'ts'), family = binomial, discrete = TRUE) I get this warning <...
3
votes
2answers
95 views

Interpreting GAM Coefficients

I could use some advice interpreting GAM (Generalized Additive Model) coefficients. I get the following results when I call coef on my model: ...
3
votes
0answers
2k views

gam: choosing between cubic and thin-plate splines

I am using gam (mgcv) to model a continuous response (a soil nutrient) in relation to a continuous predictor plus categorical predictors plus site random effects (modest number of sites) with: ...
0
votes
0answers
434 views

Modeling autocorrelation in Generalized Additive Models (GAM) with re-splines

Related to previous post for speeding up GAMM. After fitting a GAM with mgcv, the autocorrelation (acf) and partial-autocorrelation (pacf) of the residuals reveal very clear AR8 behaviors (pacf sharp ...
5
votes
1answer
193 views

Equivalence of random effects via likelihood and smoothed splines

Some fake data: X = runif(1000) ff = rep(1:10,100) E = rnorm(1000) y = x+e+f f = as.factor(ff) When you fit a model like ...
0
votes
0answers
29 views

Circular smooths within a GAM-GEE framework

I have a predictor variable which I fit in a GAM as a circular smooth term: ...
1
vote
1answer
76 views

R: generalised additive model on proportional data

Introduction I am analysing temporal population data on the amphipod Orchestia gammarellus. At several moments each year, all animals were collected from a small spot, and several life history traits ...
2
votes
0answers
196 views

Why does the predicted trend line from a gamm not match the fitted values generated by the same model?

I am using a GAMM to ask whether the first date of flowering for several plant species is occurring earlier or later over the past ~40 years (potentially due to climate change). I have separate ...
0
votes
1answer
220 views

How to model auto-correlation with a sinusoidal decay pattern in time series data?

I have ambient temperature data recorded at 90-minute intervals (16 readings per day) over approximately one year. I’m using GAMs to characterise the daily temperature profile in different seasons but ...
5
votes
0answers
37 views

Compare if two regression model behaves similarly

this is my first asking question here... forgive me if my question is not clear enough. I have two datasets; one is ground truth dataset and another is perturbed version of the same dataset. I want ...
2
votes
0answers
105 views

Difference between s() and ti() terms in mgcv package when applied to one variable

I am using the mgcv package in R to fit logistic GAMs to survey data. In one of my models I use an interaction between two covariates. I am currently trying to fit ...
0
votes
0answers
24 views

gam/gamm when response variable is complex

I would like to fit a generalized additive mixed model using mgcv or gamm4, but have a response variable consisting of complex numbers where y=a+1i*b. Is this possible, and if so are there any special ...
1
vote
1answer
21 views

How to make a random draw from a mgcv GAM model

Hi there statistical wizards! I have a (maybe) minor problem, where I would like to use the predicted fit (fit) and standard error (...
2
votes
1answer
33 views

Quadratic polynomial - how to test correlation between x and y?

I have one dependent variable (fish abundance) and one independet variable (time), both continuous. I would like to test the correlation between them because I expect that the abudance changes over ...
1
vote
1answer
228 views

Proper use of model inference (AIC) (Burnham and Anderson) - when to explore more models

I am starting an analysis, for which I have a binomial response variable (species relative abundance) and continuous predictors (habitat variables). I have done some data exploration, and there is ...
2
votes
0answers
81 views

Formulating mutli-membership random effects in lme4/GAMM4

I'm trying to fit a GAM with multi-membership random effects and nested effects in the package GAMM4, which uses lme4 syntax. Does anyone have any experience doing this in either package? Is it ...
1
vote
0answers
14 views

Model building, how to include information on data point quality?

I have a dataset with count data predictors and a marker on their reliability or completeness. With 2 options: 0 - Data is not confirmed (could be higher); 1 - data is confirmed to be complete. The ...
0
votes
0answers
17 views

Dealing with complete separation in Generalized Additive Models

Related to "How to deal with perfect separation in logistic regression?": I am modelling survival using a binomial mixed model (gamm from ...