Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [mgcv]

mgcv (Mixed GAM Computation Vehicle) is a CRAN package for the R language, it contains routines for GAMs and other generalized ridge regression with multiple smoothing parameter selection by GCV, REML or UBRE/AIC. Also GAMMs.

mgcv
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 ...
Anjeline's user avatar
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 ...
tnt's user avatar
  • 1,418
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 ...
Maria Inês Silva's user avatar
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 ...
statmaj's user avatar
1 vote
0 answers
24 views

Run mgcv package in python via rpy2

I am trying to create a python package to run mgcv in R, to replace the functionality of pyGAM. I want to start with the r command gam(), and need to use rpy2 to transfer data from R. I don't know how ...
Yifan Wang's user avatar
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, ...
David's user avatar
  • 13
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 (...
Carla Mere's user avatar
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) ...
David's user avatar
  • 13
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) + ...
we need a Mat. Stat.'s user avatar
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 ...
user25610677's user avatar
1 vote
1 answer
44 views

How can I enable openMP in Mac OS for mgcv R package?

I'm trying to run GAMMs in mgcv and hoping to utilise multi-threaded computation but openMP is not enabled on my Apple M2 Pro running Sonoma 14.1.1. I don't know a lot about the back-end of R, so ...
shanananthi's user avatar
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 ...
Arnaud's user avatar
  • 387
1 vote
2 answers
68 views

Using both foreach and bam from the mgcv package

I have several large GAM models to fit (lots of data, various distributions for residuals and random effect smooths). Currently, I use foreach with a cluster of processors based on the parallel ...
David M. Kaplan's user avatar
0 votes
0 answers
56 views

How to visualize GAM fit with a multiple imputed dataset?

I’m working with a dataset that has missing values, and I am using multiple imputation with the mice package in R. I then fit a Generalized Additive Model (GAM) using the mgcv package on the imputed ...
Katherine Drummond's user avatar
1 vote
1 answer
39 views

Cannot force legend to bottom in gratia::compare_smooths

I am using the wonderful gratia package to visualize multiple gam models from the mgcv package using the compare_smooths function. While I am able to create the gams properly and draw them, I cannot ...
flâneur's user avatar
  • 547

15 30 50 per page
1
2 3 4 5
34