# Tag Info

Accepted

### Adaptive GAM smooths in mgcv

Most of the extra smooths in the mgcv toolbox are really there for specialist applications — you can largely ignore them for general GAMs, especially univariate smooths (you don't need a random ...
• 45.7k
Accepted

### Can degrees of freedom be a non-integer number?

Degrees of freedom are non-integer in a number of contexts. Indeed in a few circumstances you can establish that the degrees of freedom to fit the data for some particular models must be between some ...
• 278k
Accepted

### When to use a GAM vs GLM

The main difference imho is that while "classical" forms of linear, or generalized linear, models assume a fixed linear or some other parametric form of the relationship between the dependent variable ...
• 3,163

### How I can interpret GAM results?

The deviance explained is a bit like $R^2$ for models where sums of squares doesn't make much sense as a measure of discrepancy between the observations and the fitted values. In generalised models ...
• 45.7k
Accepted

### Summary of a GAM fit

The way the output of this approach to fitting GAMs is structured is to group the linear parts of the smoothers in with the other parametric terms. Notice Private ...
• 45.7k
Accepted

### Generalized Additive Model Python Libraries

I've written a Python implementation of GAMs using penalized B-splines. check it out here: https://github.com/dswah/pyGAM I've included lots of link functions, distributions and features.
• 441

### When to use a GAM vs GLM

I'd emphasize that GAMs are much more flexible than GLMs, and hence need more care in their use. With greater power comes greater responsibility. You mention their use in ecology, which I have also ...
• 20.8k
Accepted

### ANOVA to compare models

The output from anova() is a series of likelihood ratio tests. The lines in the output are: The first line in the output corresponds to the simplest model with ...
• 45.7k

### Selecting knots for a GAM

Where is the idea coming from that GCV will automatically choose the number of knots? The number of knots (i.e., the basis dimension) is fixed and cannot be changed during model fit. What the GCV ...
• 652

### Generalized additive models -- who does research on them besides Simon Wood?

There are many researchers on GAMs: it's just that basically the same model (GLM with linear predictor given by sum of smooth functions) is given lots of different names. You'll find models that you ...
• 211
Accepted

### R/mgcv: Why do te() and ti() tensor products produce different surfaces?

These are superficially the same model but in practice when fitting there are some subtle differences. One important difference is that the model with ti() terms is ...
• 45.7k

### Smoothing methods for gam in mgcv package?

mgcv uses a thin plate spline basis as the default basis for it's smooth terms. To be honest it likely makes little difference in many applications which of these you choose, though in some situations ...
• 45.7k
Accepted

### Model selection for GAM in R

If you want to select from among a group of covariates, then a principled way of doing this is to put some additional shrinkage on each of the smoothers in the model so that they can be penalised out ...
• 45.7k
Accepted

### GAM vs LOESS vs splines

What matters the most is the number of effective degrees of freedom that you give to each approach. For nonparametric smoothers such as loess this is controlled by the bandwidth whereas for ...
• 86.8k
Accepted

### Can I use bootstrapping to estimate the uncertainty in a maximum value of a GAM?

An alternative approach that can be used for GAMs fitted using Simon Wood's mgcv software for R is to do posterior inference from the fitted GAM for the feature of interest. Essentially, this involves ...
• 45.7k
Accepted

### Generalized additive models (GAMs), interactions, and covariates

Q1 What's the difference between models 3 and 4? Model 3 is a purely additive model $$y = \alpha + f_1(x) + f_2(w) + \varepsilon$$ so we have a constant $\alpha$ plus the smooth effect of $x$ plus ...
• 45.7k
Accepted

### Analysed non-linear data with GAM regression, but reviewer has suggested fitting exponential or logarithmic curves instead. Which to use?

In addition to Demetri's answer (+1): The use of GAM is well-established in the field of Ecology so I would add certain books/influential articles. Show you are not reinventing the wheel rather that ...
• 42.6k
Accepted

### Two methods of adding random effects to a GAM give very different results. Why is this and which one should be used?

I suspect the difference is in terms of what fitted values you are getting. If you look at what I would call the model fit, the coefficient estimates, variance terms, the models are identical. Compare ...
• 45.7k
Accepted

### Calculating total estimated degrees of freedom for a GAM

The correct terminology for the degrees of freedom that you need to compute is model degrees of freedom. You could also compute residual degrees of freedom. The model degrees of freedom are indeed ...
• 19.7k
Accepted

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

gam1 and gam2 are fine; they are different models, although they are trying to do the same thing, which is model group-specific ...
• 45.7k

### When should I balance my data for GLM/GAM?

I would strongly suggest to avoid rebalancing your data at first instance. Especially when using a GLM/GAM to describe the tendencies of the sample at hand it makes little sense to try to up- or down-...
• 42.6k

### When should I balance my data for GLM/GAM?

+1 to usεr11852's answer. Don't worry about "unbalanced" data, as long as you use appropriate models. Are unbalanced datasets problematic, and (how) does oversampling (purport to) help? GLM/...
• 117k
Accepted

### Model construction: How to build a meaningful gam model? (generalized additive model)

The reason for the first error is that bio.percent_b500 doesn't have k - 1 unique values. If you set ...
• 45.7k
Accepted

• 45.7k

### How to choose the type of GAM-parameters

I'm assuming this is better explained in the 2nd edition of Simon's book (which should be out in a couple of days) as he and his students only worked out some of the theory for this years after Simon ...
• 45.7k
Accepted

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

The glht() function for generalized linear hypotheses from the multcomp package can be used to carry out various kinds of ...
• 15.2k
Accepted

### Smooth bivariate interaction decomposition in GAM models

Q1 There are a couple of key practical situations where the decomposed model using separate marginal smooths plus a special tensor-product interaction, or ti(), ...
• 45.7k

### Analysed non-linear data with GAM regression, but reviewer has suggested fitting exponential or logarithmic curves instead. Which to use?

That GAMs are somehow “statistical overkill” and simpler functions are “more generalizable” is a contentious claims. A priori, if you had no idea about the functional relationship between your inputs ...
• 33.5k