fable-r

Setting index in a tsibble

落花浮王杯 提交于 2021-02-11 08:47:13
问题 Do you ever look back a your old questions and feel a bit embarrassed? I just did, and now I do. And I'll probably feel the same about this one at some point. I'm trying to move my forecasting work to fable . In the process I'm trying to use a tsibble . Previously with a ts object I just set the start year and frequency. Now the tsibble is looking for a date object. However I have data which is biannual (fall and spring semester). And the variable is irregular (which I would like to keep).

forecast and fable return different outputs on same dataset for forecasting in R

情到浓时终转凉″ 提交于 2021-02-10 05:36:51
问题 I am trying to understand the different between two forecasting package forecast and fable , as the two editions of the same book (second edition and third edition seems to imply that the two packages are equivalent. library(dplyr) raw <- c(44.4082519001086, 47.1074380165289, 43.5633367662204, 43.1003584229391, 42.5828970331588, 38.3217993079585, 38.5751520417029) # raw <- c(raw,rev(raw)) forecast.df <- ts(raw) forecast::autoplot(forecast.df) + forecast::autolayer(forecast::holt(forecast.df

forecast and fable return different outputs on same dataset for forecasting in R

泄露秘密 提交于 2021-02-10 05:36:06
问题 I am trying to understand the different between two forecasting package forecast and fable , as the two editions of the same book (second edition and third edition seems to imply that the two packages are equivalent. library(dplyr) raw <- c(44.4082519001086, 47.1074380165289, 43.5633367662204, 43.1003584229391, 42.5828970331588, 38.3217993079585, 38.5751520417029) # raw <- c(raw,rev(raw)) forecast.df <- ts(raw) forecast::autoplot(forecast.df) + forecast::autolayer(forecast::holt(forecast.df

Getting null results from the accuracy function in fabletools package

旧街凉风 提交于 2021-01-29 06:05:32
问题 I have a time series that looks like this t value 1 12 2 12 3 0 4 0 5 0 6 0 7 0 I expect acf1 to equal 0.443, but instead the accuracy function produces null. The code is as following: df = data.frame("t" = 1:7, "value" = c(12, 12, 0, 0, 0, 0, 0)) tsb = df %>% as_tsibble(index = t) md = tsb %>% model(arima = ARIMA(value ~ PDQ(period = 4), stepwise = F)) fc = md %>% forecast(h = 4) accuracy(fc, tsb) Why is this happening? 回答1: The ACF1 column from accuracy() is the first auto-correlation of

Generating long-term forecasts including prophet and temporal aggregation (thief)

懵懂的女人 提交于 2020-12-15 04:55:04
问题 I just started to use {fable} and the {tidyverts} family of tools and so far it's going quite well. I'm currently interested in producing long term probabilistic forecasts from daily data (with a monthly or quarterly resolution being fine or preferred). My understanding is, that temporal aggregation could help reduce model uncertainty and also propagate known daily influences (especially holiday effects) to the e.g. quarterly level and improve accuracy that way. For the daily data I plan on

Generating long-term forecasts including prophet and temporal aggregation (thief)

旧时模样 提交于 2020-12-15 04:54:13
问题 I just started to use {fable} and the {tidyverts} family of tools and so far it's going quite well. I'm currently interested in producing long term probabilistic forecasts from daily data (with a monthly or quarterly resolution being fine or preferred). My understanding is, that temporal aggregation could help reduce model uncertainty and also propagate known daily influences (especially holiday effects) to the e.g. quarterly level and improve accuracy that way. For the daily data I plan on

Extract Model Description from a mable

亡梦爱人 提交于 2020-08-11 05:13:15
问题 I have a mable object that is like so: models # A mable: 1 x 3 ets arima nnetar <model> <model> <model> 1 <ETS(M,Ad,M)> <ARIMA(2,1,2)(0,0,2)[12]> <NNAR(14,1,10)[12]> I just want the models descriptions so I can place them in a plot. So I ran the following code: model_desc <- models %>% gather() %>% select(key, value) %>% set_names("model","model_desc") %>% mutate(model_desc_char = model_desc %>% as.character()) as_tibble() %>% select(model, model_desc) This still gives me back a tibble where

Extract Model Description from a mable

雨燕双飞 提交于 2020-08-11 05:12:06
问题 I have a mable object that is like so: models # A mable: 1 x 3 ets arima nnetar <model> <model> <model> 1 <ETS(M,Ad,M)> <ARIMA(2,1,2)(0,0,2)[12]> <NNAR(14,1,10)[12]> I just want the models descriptions so I can place them in a plot. So I ran the following code: model_desc <- models %>% gather() %>% select(key, value) %>% set_names("model","model_desc") %>% mutate(model_desc_char = model_desc %>% as.character()) as_tibble() %>% select(model, model_desc) This still gives me back a tibble where