fable icon indicating copy to clipboard operation
fable copied to clipboard

Vectorise `formula` in model functions

Open earowang opened this issue 7 years ago • 4 comments

  • 1 formula repeated for each key
  • n different formulas (lists of formulas under the hood, we could discuss a more user-friendly constructor later), where n = # of key.

Recycling rules can be implemented in fablelite.

earowang avatar Oct 12 '18 10:10 earowang

The modelr::formulas() API looks very useful. https://modelr.tidyverse.org/reference/formulas.html

earowang avatar Jan 11 '19 23:01 earowang

Yep - looks like that's suitable for our usage. I'd probably prefer the RHS to be bare, as this is more consistent with our support for bare formulae being the response.

mitchelloharawild avatar Jan 12 '19 11:01 mitchelloharawild

I've thought about this some more, and I prefer introducing a model_when() function, rather than vectorising the formula. This will allow you to apply different model specifications (and accordingly, different model formulae) to different sections of the data.

It may also be possible to use case_when() rather than introducing a new function.

mitchelloharawild avatar Jun 12 '19 01:06 mitchelloharawild

Is there still no way to specify different model formulas for different time series inside model()?

gacolitti avatar Aug 13 '20 17:08 gacolitti