John Best · @isposdef
188 followers · 678 posts · Server alaskan.social

folks: what’s the best way to parse a formula that has a mix of linear covariates and smoothers? I need a design matrix that I can send to Stan. Handling penalty terms separately for now.

@millerdl any tips?

#rstats #mgcv

Last updated 1 year ago

Shih Ching Fu · @shihchingfu
122 followers · 311 posts · Server bayes.club

@cameronpat I have wondered about this too! Especially since GAMs seem like a natural progression from "ordinary" linear models. Is it the choosing of bases or interpretation of coefficients that's a turn off? But those aren't decisions specific to . Perhaps it's just a lack of awareness? I've found in super easy to use.

#biostatistics #mgcv #rstats

Last updated 1 year ago

todd ellis · @tootstorm
206 followers · 141 posts · Server eldritch.cafe

issues I'm struggling with that seem impossible to Google: Building a {brms} model within the {tidymodels} framework using {bayesian}.

The formula is inherently too complex (including splines and random effects) for the typical tidymodels workflow that involves recipes &c., so it must be added in at a later step. Two things:

1. Complex {brms} multivariate formulas seem to not be possible using {tidymodels}. E.g., literally multivariate or including phi after my formula via brms::bf(). It simply errors. :( This may just need some tweaking of {bayesian}'s scripts or waiting for an update since it's still fairly young.

2. Using {mgcv} random effect syntax like s(cat1, cat2, bs = "re") seems to not pick up as random effects in the model...I think? And I have never figured out if this is creating hierarchical random effects or not -- or if multilevel random effects just aren't possible in this syntax(?).

3. Using {lme4} random effect like (1 | cat1 / cat2) to ensure the hierarchy is preserved *does* retain random effects I can pull out of the model later using `ranef`, but for some absurd reason I cannot run this model through cross-validation or a myriad of other steps later because it seems to force-create a complex web of interacting factor levels that don't exist. E.g., if my random effects are '(1 | realm / biome)', this eventually fails because it'll look for tundra biome types in Africa for some absurd reason.*

Noticed this while trying to solve *separate* issues within broom.mixed:::tidy.brmsfit() -- that it seems to delete the names of all the fixed effects and return them as 'NULL' character strings (???), and its reliance on 'ranef' means it doesn't find the random effects using {mgcv} syntax.

That's my rambling mess of an essay for the day. Not sure how many of these are real issues or me simply not understanding how these packages differ or wot.

* Almost wondering if this might even be a separate {tidymodels} issue right now. Every recipe no matter what seems to factor every single character column regardless of how the recipe is built. Hmmmm.

#rstats #brms #mgcv #tidymodels

Last updated 1 year ago

Noam Ross · @noamross
1634 followers · 660 posts · Server ecoevo.social

Absolutely gaga over this new preprint by Nick Clark and the @weecology group. So many methodological threads - long-term ecological monitoring, an open data system, careful semi-parametric models, simulation-based inference and forecasting rigor - combine into predicting complex multispecies dynamics while learning about their relationships + drivers

ecoevorxiv.org/repository/view, code at github.com/nicholasjclark/port

Thread from nick at: twitter.com/nj_clark/status/16

#ecology #forecasting #efi #mgcv #rstats

Last updated 1 year ago

Collin Edwards · @collinedwards
179 followers · 226 posts · Server ecoevo.social

question:

I'm working with very large data, and am fitting smoothing splines with the `bam()` function, and `discrete = TRUE` (which is an amazing speed boost!)

When I want to predict new data from the fitted model, is there any reason why I can't set `discrete = FALSE` in `predict.bam()`? That is, the fitted bam model is still just a gam fitted model, right?

(I have *many* levels for a random effect, and the discretized predictions are erroring out with "data is too long")

#rstats #mgcv

Last updated 1 year ago

DavidLawrenceMiller · @millerdl
180 followers · 307 posts · Server mastodon.social

friends πŸŽ‰πŸ’»πŸˆ

two bots of potential interest

@mgcv_updates tells you about what's new in

and

@rverbsr is a silly bot that toots "verb that noun" phrases where the verbs are functions in R base and the nouns are R types

enjoy!

#rstats #mgcv

Last updated 2 years ago

DavidLawrenceMiller · @millerdl
198 followers · 495 posts · Server mastodon.social

friends πŸŽ‰πŸ’»πŸˆ

two bots of potential interest

@mgcv_updates tells you about what's new in

and

@rverbsr is a silly bot that toots "verb that noun" phrases where the verbs are functions in R base and the nouns are R types

enjoy!

#rstats #mgcv

Last updated 2 years ago

Noam Ross · @noamross
872 followers · 110 posts · Server ecoevo.social

OK, a first convening of team here: @ericJpedersen @gavinsimpson @millerdl .

If I want to fit a spline but constrain it to going through certain points (e.g., the start and end of an epicurve should be zero), what's the best way? I'm thinking of adding points to the data at the ends of the range with very high weights. Not sure what the consequences of that would be.

#gams #mgcv #rstats

Last updated 2 years ago

Tiago Peixoto · @tiago
738 followers · 3170 posts · Server social.skewed.de

I can feel the planet heating...

RT @ucfagls@twitter.com

A beautiful sight, when fitting a BAM to ~4 million rows of data

πŸ¦πŸ”—: twitter.com/ucfagls/status/146

#rstats #mgcv

Last updated 3 years ago