Stack Exchange Network

Stack Exchange network consists of 174 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
Make your voice heard. Take the 2019 Developer Survey now

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
10 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
29 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
21 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
96 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
18 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
26 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
21 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
86 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
37 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
26 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
28 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
49 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
31 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
38 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
73 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 ...
9
votes
3answers
991 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
31 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
48 views

Non-normal random effects in a logistic GAM

I have estimated the following GAM using the mgcv package: ...
0
votes
0answers
28 views

Handling collinearity in GAM

I am interesting if a variable x1 is of importance for the outcome y. To investigate this I am trying to fit a model A1 <- gam(y~ s(x1) + s(x2) + x3 + x4 + x5 + x6)) where x1 and x2 are ...
0
votes
0answers
47 views

How do I adress non-normal residuals in gam/gamm

I am trying to fit a GAM where the outcome (y) depends on 2 continuous variables (v1 and v2) and 4 categorical variables (v3-v6). $$M1 <- \mathrm{gam} (y \sim s(v1) + s(v2) + v3 + v4+ v5+ v6)$$ ...
1
vote
0answers
25 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
79 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
69 views

Strange qqplot for poisson gam

I've built a gam using mgcv and the following code ...
1
vote
1answer
46 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
14 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
82 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 ...
-1
votes
0answers
21 views

Is it possible to control the degrees of freedom for the internal smooth on a soap-film?

I am using the mgcv package in R to fit a gam to spatial measurements of density. My aim is to use this gam primarily for spatial interpolation and smoothing, but ...
0
votes
0answers
31 views

GAM and Mgcv package problem in R (about LOESS)

I have question about gam package in R. I am trying to use LOESS function in gam::gam package, however, the package doesn't seem to offer much applications such as gam.check or concurvity from mgcv::...
0
votes
0answers
45 views

difference between LOESS and Spline

I wonder what is the difference between LOESS and Spline. I heard that LOESS is similar with Moving Average. So, is Spline(s) from mgcv::gam is also similar with moving average ? if not, please ...
0
votes
0answers
30 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
107 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 ...
2
votes
1answer
45 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
61 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
39 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
61 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 ...
0
votes
0answers
67 views

about Generalized Additive Model after ARIMA or ARMA on independent variables

I am trying to use generalized additive model for my analysis. However, I have question about the model. First question is, what is backfitting algorithm exactly ? I searched up but still don't ...
0
votes
1answer
44 views

about Generalized Additive Model

I know that Generalized Additive Model is used in Many Health Science Analysis. However, I wonder why it only consider some weather variables and time variable as independent variable not other ...
0
votes
0answers
160 views

gam.check result interpretation

I am having trouble with interpreting gam.check result. Can someone explain how to explain this ? Is my result something wrong ? how it should have to be like ?
1
vote
0answers
29 views

Determine maxima and minima of fitted GAMM smooth

I have been using gamm4 to model the daily activity pattern of a certain behavior as a binomial response (whether the behavior occurs or not for each hour of the day). I am comparing the daily ...
0
votes
0answers
13 views

Using GAMs to model time-series-like data

My gym tweets out how many people are in the weight room throughout the day. I have scraped the data and put it into a SQLite database here. I'm interested in using GAMs to model how many people ...
0
votes
0answers
39 views

generalized additive model with nonstaionary dependent variable (time-series analysis)

I am trying to use gam model to analyze pm2.5 effect on death. However, the dependent variable 'death number' is not stationary. (the data is Time Series data) What I know is for Time Series data I ...
0
votes
1answer
66 views

Generalized Additive Model (k value)

I am trying to have result with GAM using R. In R, I am using mgcv and the code is following. However, I do not understand what k value for? If I want to see the seasonal effect on time then ...
1
vote
1answer
51 views

Generalized additive models - formula for basis functions

I'm trying to understand the basics of GAMs. Wood's book "Generalized Additive Models: an introduction with R" introduces GAMs via a cubic spline basis $b_j(x)$ (see p. 122), where $b_1(x)=1, b_2(x)=...
1
vote
0answers
49 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
65 views

Interpretation of Tensor product splines with multiple terms and their standard errors?

I am trying to understand the tensor product splines such as ...
0
votes
0answers
42 views

GAM and Bayes models

I am wondering whether GAMs with splines can be translated into simpler models. Splines require a lot of coding if you don't use existing functions. Imagine you have a time series model $y_t = a + ...
1
vote
1answer
189 views

Extracting significance of gam smoothing terms

I have a time course data to which I'd like to fit a gam and have easy interpretability, and by that I mean obtaining coefficient...
0
votes
0answers
20 views

Best method for a prediction model with a spline term

I would like to run a prediction model on a dataset of about 500- outcome is binary. One of my continuous predictors is non-linear and I am interested in a total of 7 predictors. What is the best ...
0
votes
0answers
28 views

Why the df in GVIF test is zero?

I am developing a GAM model,and when I test the vif of the gam model, the result is strange. Is there any problem with my model? The picture is the results. PC1 and PC2 are two independent variables ...
0
votes
0answers
28 views

Average the confidence intervals for multiple predictions

I've been doing some mixed modelling and obtaining model predictions for the size of a population through time. Each of these predictions comes with a confidence interval calculated from the various ...