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.

0
votes
0answers
18 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
0answers
12 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
5 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
0answers
8 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 ...
1
vote
0answers
23 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
66 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: ...
1
vote
1answer
63 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 ...
5
votes
0answers
34 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
69 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
19 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
18 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 ...
2
votes
0answers
79 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
13 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
15 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 ...
1
vote
1answer
52 views

Why doesn't penalized cubic regression reduce the number of knots in a GAM?

As far as I understand, cubic regression penalization prevents overfitting by reducing the number of knots by penalizing wiggliness. The supplied parameter k serves ...
0
votes
0answers
26 views

Circular smooths within a GAM-GEE framework

I have a predictor variable which I fit in a GAM as a circular smooth term: ...
2
votes
0answers
31 views

GAMM with multiple and crossed random effects

I am new to Generalized additive mixed models (GAMM) and I'm trying to model a behavioral response variable (time spent shading eggs by a nesting bird in minutes ...
1
vote
1answer
57 views

How to fit a longitudinal GAM mixed model (GAMM)

I have repeated measurements of individuals, like this ...
3
votes
1answer
43 views

Why p-values are not significant even though AIC values improved a lot in model selection using GAM mix modelling and beta regression

Dear StatExchange community, I am studying disease progression in plant leaves and I am trying to estimate differences between a wild-type and a mutant plant. To achieve this I am using the ...
1
vote
1answer
21 views

Whats is the difference between using risk() and cvrisk() in the R package mboost

I am currently running an additive model using the function gamboost() in the package mboost. When using the ...
1
vote
0answers
35 views

Data exploration to determine if GAMs are appropriate [duplicate]

How to decide, based on data exploration and data visualisation, between a GAM and a GLM. Linear Models (LM) assume that the relationship between the response and the predictor are linear. ...
1
vote
1answer
44 views

Random effect in GAM - what are the smooth functions used?

In the GAM package in R created by Simon Wood there is a selection of the smooth function basis. I sort of understand the options such as bs='tp', bs='cr', etc. But bs='re' seems odd... that does ...
4
votes
1answer
112 views

How much of a problem are autocorrelated residuals of a binary GAM (Generalized Additive model)?

I'm trying to predict high or low crime rate in municipalities (binary 1/0 response variable) using a range of socioeconomic variables. Im doing this with a panel dataset with 300 municipality over 17 ...
1
vote
1answer
25 views

Differences between “in-bag” and “out-of-bag” empirical risks in the R package “mboost”

currently I am using the mboost R-package to estimate some additive models. When using the function gamboost(), you can control the hyper-parameters for boosting by using the option boost_control(). ...
0
votes
0answers
44 views

GAM residuals , GAM check

I am doing my GAM regression analysis in R and by using the gam.check() function from the ...
0
votes
0answers
25 views

Additive Gaussian Processes with Penalized Likelihood

I have a problem with many - say $D$ - input variables, $\mathbf x=(x_1,\dotsc,x_D)^\top$. I have have dataset $\mathcal D$ of $n$ input/outputs, with $n<D$. Only $\delta<<D$ should suffice ...
2
votes
0answers
101 views

Time series models (e.g. ARMA) a type or extension of GLM? Particular/stipulated forms of dependence in time series models

I am trying to understand the relationship between ARMA Time Series models and the GLM (Generalized Linear Model) family of models. As far I know, all GLMs have the following 3 components: 1) random ...
2
votes
1answer
54 views

Modeling academic seasonality with hierarchical GAMs

I am trying to model the seasonality of daily pageviews to calculus-related Wikipedia articles using a hierarchical GAM, assuming that there is a shared 'academic calendar' seasonality and that each ...
1
vote
1answer
30 views

predict.bam() produces different results when data is subset

Apologies in advance since I cannot provide a reproducible example due to the immense size of my model. I'll do my best to describe my situation fully, hopefully this will be sufficient. My model ...
0
votes
1answer
36 views

using normal Generalized additive model rather than zero inflated regression

I am doing regression analysis for my data , nearly half of my data is Zero . I have conducted Generalized additive model for my data ; but I was wondering if it is enough to do only generalized ...
4
votes
2answers
52 views

What is Dimension of basis in splines

From mgcv package, gam(for generalized additive model fit) function uses the parameter 'k' which is dimension of basis. Can anyone explain to me what does dimension of basis function means in spline ...
2
votes
1answer
43 views

GAM using a cyclic spline improves residual structure but reduces fit

I'm working on a dataset monitoring soil moisture levels throughout the summer. The general trend in the data is the following: When I use a GAM with default thin-plate spline and AR(1)process there ...
3
votes
1answer
42 views

why does ignoring spatial autocorrelation lead to spurious significance

In spatial statistics one often hears the statements like the following: unaccounted for spatial autocorrelation may lead to spurious significance / understimated uncertainty / too narrow ...
0
votes
1answer
201 views

Time series analysis via generalized additive models: model assumptions and stationarity

I have settled on building a generalized additive mixed model using mgcv::gamm, on data and for purposes I have described in more detail here. In a nutshell, I want ...
10
votes
3answers
1k views

When to use a GAM vs GLM

I realize this may be a potentially broad question, but I was wondering whether there are generalizable assumptions that indicate the use of a GAM (Generalized additive model) over a GLM (Generalized ...
2
votes
0answers
42 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 ...
3
votes
1answer
54 views

Non-normal random effects in a logistic GAM

I have estimated the following GAM using the mgcv package: ...
1
vote
0answers
27 views

Thin Plate Regression Spline Problem

I fitted a Thin Plate Regression Spline into some non-linear relationships and I get good results, but I had problems in the tails of the distributions. Someone knows what could be the cause of this ...
1
vote
1answer
128 views

Correcting for multiple pairwise comparisons with GAM objects {mgcv} in R

My question concerns pairwise comparisons of factor levels in a gam object. I have a dataframe, df, containing reaction time data (in ms) to stimuli varying in ...
3
votes
2answers
110 views

Strange qqplot for poisson gam

I've built a gam using mgcv and the following code ...
1
vote
1answer
55 views

Smoothing in Time and Space, with Random Effects

Setup My city has recently run a pilot program to mandate that only public transportation use particular sections of the downtown core. The city has released data about the program. They have ...
1
vote
0answers
17 views

Difference between tensor product and main effects plus interaction in mgcv [duplicate]

I was under the impression that using te and adding the main effects with s plus the interaction with ...
1
vote
1answer
168 views

GAMM with Zero-Inflated Negative Binomial - Looking for a package on R

I am looking for an R package to fit Generalized Additive Mixed Models with ZINB distribution, as ZINB is not available in the mgcv package nor in the gamm4 package. I read here that it might be ...
0
votes
0answers
31 views

probability confidence intervals for intercept

I have a GAM model with about 10 variables and 450 observations. I ran a simple GAM regression using R and I noticed that everything looks OK, except that one of the splines has many zeros in the p ...
0
votes
1answer
191 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 ...
1
vote
1answer
51 views

Is Repeated Measures ANOVA appropriate for flower production over time?

I wanted to check here to see if a repeated measures ANOVA would be a good option to analyze my data, or if you have any other suggestions? I have read that GLMM is another option for time series data,...
2
votes
1answer
79 views

GAM interaction- how to interpret

I am working with a GAM model (based on a negative binomial distribution): model_n = gam(y ~ x1 +x2+ x3+x4 + s(x5)+x6+s(acc, by=ses)+x7+x8+ x9+x10, data=totalfinals, family=negbin(3)...
2
votes
1answer
46 views

Inconsistent mgcv gam.check results

I'm not sure if this question is appropriate for cross validated, but I'm not sure where else to post it. I've built a simple model using the mgcv package. <...
2
votes
0answers
75 views

Why is GAMM fit so poor?

I have annual measurements of these 3 IDs and would like to visualise their overall trend (one curve) using R's gamm function in order to control for ...