Tools for time series analysis in R. Use this tag for questions about programming with tidyverts.
Questions tagged [tidyverts]
23 questions
7
votes
1 answer
Problems with hierarchical modelling/reconciliation in tidyverts
I'm trying to do hierarchical forecasting after the fashion of Rob Hyndman's Rstudio.conf workshop, and running into some problems. Here is my code:
library(dplyr)
library(tsibbledata)
library(tsibble)
library(fable)
aus_retail_2013_tr <-…

Hong Ooi
- 56,353
- 13
- 134
- 187
7
votes
2 answers
Interpolation of irregular time series with R
Searching for linear interpolation of time series data in R, I often found recommendations to use na.approx() from the zoo package.
However, with irregular timeseries I experienced problems, because interpolated values are distributed evenly across…

Jens Daniel Müller
- 115
- 1
- 8
3
votes
0 answers
R fable logit transformed exponential smoothing forecast producing unexpected result
I have tried and tried to figure this out but am having no luck!!
I have constructed a model that aims to forecast a relatively short time series using an exponential smoothing method. The results need to be constrained to between 0 and 1, so I use…

rohan
- 31
- 3
2
votes
1 answer
Forecasting irregular stock data with ARIMA and tsibble
I want to forecast a certain stock using ARIMA in a similar way that R. Hyndman does it in FPP3.
The first issue that I've run into is that stock data is obviously irregular, since the stock exchange is closed during weekends and some holidays. This…

resto
- 23
- 1
- 3
2
votes
0 answers
Hyperparameter optimization while using fable.prophet?
I would like to do hyperparameter optimisation while using the awesome fable package(here fable.prophet) from tidyverts
Using the example of fable.prophet like as mentioned at https://github.com/mitchelloharawild/fable.prophet.
fit <- cafe %>%
…

cube
- 345
- 1
- 2
- 9
2
votes
1 answer
Integration of Variable importance plots within the tidy modelling framework
Could somebody show me how to generate permutation-based variable implots within the tidy modelling framework? Currently, I have this:
library(tidymodels)
# variable importance
final_fit_train %>%
pull_workflow_fit() %>%
vip(geom = "point",
…
1
vote
1 answer
Categorise data based on the trend
I have a data on individuals with their titre levels. The titre levels are in ordered categories. Instead of using the labelled values, I have used the numeric values - this would allow me to see the trend. My logic as follows:
If the values are…

HNSKD
- 1,614
- 2
- 14
- 25
1
vote
1 answer
I want to filter group id's specific conditions meeting on both column and some row value in r
I have sample data and I want to filter the number of id's never had sup status while on type ==N, meaning I only choose id with status == unsup while before switching type, and then the number id's who switched from N to P.
for example id==1 never…

Mahlet Tadesse
- 159
- 6
1
vote
1 answer
Why are NAs being produced from pivot_wider?
I am trying to pivot my dataframe from tidy format to wide format, using a column with two values, using the following:
bai_wide = bai_trim %>% pivot_wider(names_from = Species, values_from = BAI)
But when I do this, NAs are produced in the…

brlockwood
- 135
- 7
1
vote
1 answer
Generating long-term forecasts including prophet and temporal aggregation (thief)
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…

stats-hb
- 958
- 13
- 31
1
vote
3 answers
How to unnest samples from a fable R forecast model
I am trying to get the samples from a forecast model generated with fable. This is what I tried
library(fable)
library(tsibble)
library(tsibbledata)
library(dplyr)
library(tidyr)
# Forecasting with an ETS(M,Ad,A) model to Australian beer…

Alex
- 2,603
- 4
- 40
- 73
1
vote
1 answer
Aggregating forecasts using Fable
Issue:
Using fable I can easily produce forecasts on a time series with a grouped structure, and can even use Fable's aggregate_key/ reconcile syntax to produce a coherent top-level forecast. However I'm unable to easily access the aggregate…

wurli
- 2,314
- 10
- 17
1
vote
2 answers
Extract Model Description from a mable
I have a mable object that is like so:
models
# A mable: 1 x 3
ets arima nnetar
1 …

MCP_infiltrator
- 3,961
- 10
- 45
- 82
0
votes
1 answer
How to control the fill_gaps interval in tsibble?
I have two data frames that fill missing in different intervals.
I would like to fill the two to the same interval.
Consider two data frames with the same month-day but two years apart:
library(tidyverse)
library(fpp3)
df_2020 <- tibble(month_day =…

Isaiah
- 2,091
- 3
- 19
- 28
0
votes
1 answer
Irregular time series in fable package
In the tsibble package and fable package, I think I read somewhere that we can handle irregular time series.
I could not find anything with examples on how to do it. Some questions I have are:
Do I have to convert irregular timeseries to a regular…

ok1more
- 779
- 6
- 15