Questions tagged [gam]
GAM (Generalized Additive Model) is a statistical model used to combine Generalized Linear Models with Additive Models.
719
questions
0
votes
0
answers
3
views
'sdm' function ensemble model warning messages ('rf', 'gam', 'mars')
I'm running into warning messages when I include several model methods into my 'sdmData' function. Here's the code:
d <- sdmData(formula = sp~.,train=PO, predictors=env_raster, bg=background)
#PO =...
0
votes
0
answers
28
views
R gamlss - Last error message: object 'fit' not found [duplicate]
After executing several data correctly, it throws the error : Last error message: object 'fit' not found
any ideas?
train_modelo<-function(data,x){
codigo <- x[,1]
family <- x[,2]
...
0
votes
0
answers
20
views
SVC GAM in the presence of factor variable and transformation of coefficients into relative risk
I would like to get your confirmation on two doubts I have on the application of SVC GAM.
Basically, I would like to know
how to deal with factor variables when predicting spatially varying ...
1
vote
1
answer
19
views
Exporting summary.betareg and summary.gam from list to csv
I have two types of models (GAM and beta regression) that I am running for my data and I am using a lapply function to iterate over multiple variables. I am encountering an error when trying to export ...
0
votes
0
answers
20
views
structure of multinomial model in mgcv
I am trying to model the proportions of a variable with four categories through time and at four different sites. Most sites have all four categories of the variable, but some sites only have three ...
0
votes
1
answer
51
views
Prediction values don't match fitted function from GAM model
I have a presence/absence data for a species occurrence and I did a binomial GAM using sea surface temperature (sst) as a predictor variable.
My df object is a data.frame with the presence/absence ...
0
votes
0
answers
12
views
Effects Contrast Matrix for Interaction with Multiple Grand Means
I want to include an interaction between two factors: area and house_type, in my GAM (MGCV), I hope to make a sum-to-zero contrast encoding.
But, I do not want each combination of the factors to be ...
1
vote
1
answer
59
views
predict.gam behaviour gives error in R4 but works in R3. full reprex included
In R version 3.6.3, my predict.gam function gives a result. When I use R 4.x, I get errors for some types of predict, but not others.
My goal is to be able to use this code in R4.
library(gam)
gm1 &...
0
votes
0
answers
68
views
Missing category in reference level in multinomial GAM with mgcv in R
Consider the multinomial GAM with mgcv in R
library(mgcv)
multinom = gam(list(sound ~ word + s(long, lat),
~ word + s(long, lat),
~ word + s(long, ...
0
votes
0
answers
31
views
gam function output (mgcv package)
How can I improve my bam model if 3/4 gam.check plots show poor diagnosis, except for the histogram of residuals (which shows a normal distribution).
My response variable is soundscape saturation (...
0
votes
1
answer
120
views
Step failure (and iteration limit) in multinomial GAM with mgcv in R
I have a data set with 40 sites (long, lat) by 2 ages by 2 genders by 6 words and 6 dependent sound categories (coded 0 to 5) as simulated here:
sound <- sample(0:5, size=960, replace=T)
...
1
vote
0
answers
48
views
mgcv predict.gam in R version 4 gives error, in R version 3, no error
In R version 3.6.3, my predict.gam function gives a result. When I use R 4.x, I get errors for some types of predict, but not others:
library(gam)
library(dplyr)
gm1 <- predCol ~ s(VCF_nontree) + ...
1
vote
1
answer
22
views
How to Plot Difference Smooth with confidence Intervals using gamm4 in R
I am currently working on fitting splines with gamm4 and I have hierarchical data. In my dataset, Trial_no is nested within VP, and SoundType (levels: STA and DEV) is a level-1 predictor. My model ...
1
vote
0
answers
29
views
Finding x at maximum/peak of a Generalised Additive Model (GAM) of y~x
I am attempting to model species' responses to an environmental gradient to characterise their niche in terms of this gradient. I will be using a data on presence/absence of species in grids along ...
1
vote
1
answer
30
views
Plotting a QQplot from a logistic GAM fitted with mgcv and using weights
Here is a little script describing my problem.
I am fitting a logistic model in R using the mgcv package.
The dataset represent the occurrence of an event under certain conditions.
For this model, I ...