fabletools | General fable features useful for extension packages
kandi X-RAY | fabletools Summary
kandi X-RAY | fabletools Summary
The R package fabletools provides tools for building modelling packages, with a focus on time series forecasting. This package allows package developers to extend fable with additional models, without needing to depend on the models supported by fable.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of fabletools
fabletools Key Features
fabletools Examples and Code Snippets
Community Discussions
Trending Discussions on fabletools
QUESTION
I am doing some time series forecasting analysis with the fable
and fabletools
package and I am interested in comparing the accuracy of individual models and also a mixed model (consisting of the individual models I am using).
Here is some example code with a mock dataframe:-
...ANSWER
Answered 2021-Dec-07 at 11:04A couple of things to consider:
- While it's definitely desirable to quickly evaluate the performance of many combination models, it's pretty impractical. The best option would be to evaluate your models individually, and then create a more simple combination using, e.g. the 2 or 3 best ones
- As an example, consider that you can actually have weighted combinations - e.g.
0.75 * ets + 0.25 * arima
. The possibilities are now literally endless, so you start to see the limitations of the brute-force method (N.B. I don't thinkfable
actually supports these kind of combinations yet though).
That, said, here's one approach you could use to generate all the possible combinations. Note that this might take a prohibitively long time to run - but should give you what you're after.
QUESTION
Is there any way to use autoplot with a fable, but facet it by the model? The code below produces a nice little graph, but overlays the forecasts on top of each other.
...ANSWER
Answered 2021-Jul-08 at 18:47Maybe this is what you are looking for. As autoplot
returns a ggplot object you could simply add facet_wrap(~.model, ncol = 1)
QUESTION
Question: i have the following R code (below): It didn't work with "x" = "ARIMA" and "ETS" from "my.list". That's the problem: "fabletools::model(arima_auto = fable::ARIMA(Trips))" = it works, but this: "fabletools::model(arima_auto = fable::x(Trips))" didn't work. Does anyone know the solution to my problem. Is it even possible in R?
...ANSWER
Answered 2021-Mar-11 at 20:38When you're calling x(Trips)
, your x is the character vector "ARIMA"
. R has no idea what [character vector](Trips)
means. It would be like trying to call "Alice"(y)
and expecting R to treat "Alice"
as a function, even though it clearly is not one.
What you want is a way for R to swap the string "ARIMA"
for its corresponding function. This is what match.fun
is for. Try this instead:
QUESTION
How do I "turn on" the progress bar for slower model()
s?
It seems to be an option according to development in fable and fabletools... but I can't turn it on.
Can someone please tell me what I am missing?
...ANSWER
Answered 2021-Jan-17 at 10:32Progress bars can be enabled by wrapping your code with with_progress()
from the progressr
package. Further customisation can also be found from the progressr package documentation: https://cran.r-project.org/web/packages/progressr/index.html
QUESTION
I am doing some work which involves modelling values over time, and in the interests of clarity I would like to use the fable
package to do this. I want to create a linear model over time with a log transformation - however, I have found that the values generated by fable::TSLM()
are in some cases significantly different from those generated by stats::lm()
, which has been previously used in the model. It's possible that this issue is caused by my incorrect use of fable
functions, however it may also be a bug in the package. The following reprex illustrates my issue:
ANSWER
Answered 2020-Dec-10 at 14:31As stated on link there is a little correction with transformed data in the package fable to produce means instead of medians.
I think it comes from this, as you use a log transformation that modifies the residual law.
Note that if you use point_forecast = list(Fable_Model = median)
both models give the same results.
So I guess fable is right
QUESTION
I'm trying to extract the forecast residuals using fabletools package. I know that I can extract the fitted model residuals using the augment()
function but I don't know how that works for the forecasted values and I get the same results as the fitted model residuals. Here is an example:
ANSWER
Answered 2020-Nov-03 at 06:30I think you probably want forecast errors --- the difference between what is observed and what was predicted. See https://otexts.com/fpp3/accuracy.html for a discussion. To quote that chapter:
Note that forecast errors are different from residuals in two ways. First, residuals are calculated on the training set while forecast errors are calculated on the test set. Second, residuals are based on one-step forecasts while forecast errors can involve multi-step forecasts.
Here is some code to compute forecast errors on your example.
QUESTION
I have created a function which allows me to carry out time series forecasting using the fable
package. The idea of the function was to analyse observed vs predicted values after a particular date/event. Here is a mock data frame which generates a column of dates:-
ANSWER
Answered 2020-Oct-16 at 13:20I suppose you could rewrite it this way. I made a couple of adjustments to help you out.
QUESTION
As described here, making one-step forecasts in the test set is a way of avoiding the inevitable increase in variance as a forecast horizon increases. Mentioned in that section are methods to perform one-step forecasts on the test set using an already-trained model, for the forecast
package. Is there a similar way of performing a one-step forecast for test data using the newer fable
package? Perhaps the new_data
parameter described here, for example handles this, but I am not sure, as the forecasts for both h = 24
and new_data = x_test
are the same below:
ANSWER
Answered 2020-Oct-13 at 06:21The model
argument available for many models in the {forecast}
package is equivalent to the refit()
method in the {fable}
package. When used with future data, it can be used to produce multiple one-step forecasts from a model.
QUESTION
I am trying to estimate ARIMA models for 100 different series. So I employed fabletools::model()
method and fable::ARIMA()
function to do that job. But I couldn't able to use my exogenous variables in model estimation.
My series has 3 different columns, first ID tag identifying the first outlet, then Date.Time tag, and finally the Sales. In addition to these variables I also have dummy variables representing hour of day and week of day.
Following the code given bellow I transformed the dataframe which contains my endegounus and exegenous variables to tstibble.
...ANSWER
Answered 2020-Oct-09 at 07:13Here is an example using hourly pedestrian count data.
QUESTION
I do not have a workaround for this at the moment, so desperately looking to solve this issue, no matter how cumbersome as long as my code is working again...
I want to coerce a tsibble to a fable object with:
...ANSWER
Answered 2020-Sep-28 at 11:57It's not the most intuitive error message, but I have experienced this before with this function. You actually have to pass Debt
to both arguments. I believe the error message references .mean
because of an error thrown by an internal function.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install fabletools
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page