You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a most useful package;
I have just started using the package and I am having trouble fitting a gam with random effects.
With my data, being able to include such options in the formula enables superior GAM models, e.g. deviance explained for a simple GAM = 33.5%, and deviance explained for a GAM with random effects = 48.1%.
I used the code from the fit_gam help to illustrate the issue - see below.
fit_gam fails with: Sorry, but it was not possible to fit the model
Am I specifying the formula correctly?
Many thanks for any help,
Darren
Hi Darren
Thank you for reporting this problem. The issues seem to be related to predictors_f argument. If you declare landform as a continuous variable, it works.
This is a most useful package;
I have just started using the package and I am having trouble fitting a gam with random effects.
With my data, being able to include such options in the formula enables superior GAM models, e.g. deviance explained for a simple GAM = 33.5%, and deviance explained for a GAM with random effects = 48.1%.
I used the code from the fit_gam help to illustrate the issue - see below.
fit_gam fails with: Sorry, but it was not possible to fit the model
Am I specifying the formula correctly?
Many thanks for any help,
Darren
data(abies)
abies2 <- part_random(
data = abies,
pr_ab = "pr_ab",
method = c(method = "kfold", folds = 5)
)
require(mgcv)
gam_test <- gam(pr_ab ~ s(aet) + s(landform, bs = "re"), data = abies2)
summary(gam_test)
gam_t2 <- fit_gam(
data = abies2,
response = "pr_ab",
predictors = c("aet"),
predictors_f = c("landform"),
select_pred = FALSE,
partition = ".part",
thr = "max_sens_spec",
fit_formula = stats::formula(pr_ab ~ s(aet) + s(landform, bs = "re"))
)
The text was updated successfully, but these errors were encountered: