Questions tagged [tsibble]

R package for tidy time series (tsibble: Tidy Temporal Data Frames and Tools)

tsibble: Tidy Temporal Data Frames and Tools

Provides a 'tbl_ts' class (the 'tsibble') for temporal data in an data- and model-oriented format.

The 'tsibble' provides tools to easily manipulate and analyse temporal data, such as filling in time gaps, aggregating over calendar periods, and etc.

119 questions
0
votes
1 answer

Ausbeer lag plot using gg_lag() fails

ausbeer %>% as_tsibble() %>% filter(year(index) >= 1992) %>% mutate(Year = year(index), Quarter = quarter(index)) %>% as_tibble() %>% select(Year, Quarter, value) %>% pivot_wider(names_from = Quarter, values_from = value) %>% …
0
votes
1 answer

Setting the key in tsibble data conversion

In tsibbledata package, key of vic_elec data seem like row key. library(tsibble) library(tsibbledata) library(lubridate) data('vic_elec') str(vic_elec) str(dt) tsibble [52,608 x 5] (S3: tbl_ts/tbl_df/tbl/data.frame) $ Time : POSIXct[1:52608],…
Sang won kim
  • 524
  • 5
  • 21
0
votes
1 answer

Why do I get the wrong date back when I format a tsibble yearweek object back to year month day (yearweek "2020 W01" formats to "2020-12-30")

library(tsibble) #> #> Attaching package: 'tsibble' #> The following objects are masked from 'package:base': #> #> intersect, setdiff, union (yw <- yearweek("2020-01-01")) #> #> [1] "2020 W01" #> # Week starts on:…
sagrules
  • 31
  • 1
  • 7
0
votes
2 answers

How to use a character value when using the 'model' function to call the model/variable to forecast?

My aim is to make a function where you input the variable you want forecasted, and then use cross validation on multiple types of models (ie. Naive, ETS, Mean), then using the 'pull' function I will pull out the model with the lowest RMSE, then I…
0
votes
1 answer

Can a tsibble obj. have multiple rows of the same date and associated row value?

I have a data frame that I am converting into a tsibble time series object to allow for easier timeseries graphing and manipulation (rolling time window analysis) of data. I obtain new data daily that I would like to append on to the original data…
JJ Fantini
  • 213
  • 1
  • 11
0
votes
1 answer

Make feature return different classes

I'm trying to create my own feature, which I want to return both POSIXct and numeric values. I discovered the only workaround is to use the unnest() after the features function. Can we simplify this workflow? I want to include features in my…
atsyplenkov
  • 1,158
  • 13
  • 25
0
votes
0 answers

tsibble::yearmonth does not convert properly the format "2016.11" and "2016.12"

There's a small issue with tsibble::yearmonth. See this list of year - months values: x <- c("2016.09", "2016.10", "2016.11", "2016.12") When I call tsibble::yearmonth (tsibble version 1.0.0), I obtain this: tsibble::yearmonth(x) [1]…
0
votes
1 answer

tsibble: Extract two keys from a ts object

I'm working with the Seatbelts ts dataset and want to convert it to a tsibble where I can use DriversKilled grouped by law, or including law as a key to be used later. Using head(as_tsibble(Seatbelts)) creates the tsibble with the date index as…
pdw
  • 338
  • 2
  • 8
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
0
votes
1 answer

CCF vs ccf: What;s the Difference?

I'm trying to understand the difference between feasts::CCF vs. base::ccf and why they produce different results in the reprex (do the NAs have something to do with it?) ## Data df <- structure(list(date = structure(c(1590919200, 1590922800,…
Thomas Speidel
  • 1,369
  • 1
  • 14
  • 26
0
votes
1 answer

Given a tsibble with more than one key, is tidyverts able to box_cox() each time series using a respective lambda_guerrero value per time series?

My question is: if I had a tsibble with more than one key (n_keys > 1), and either one or more key variables (key_vars >= 1), is the tidyverts suite able to perform a box_cox transformation on each time series (one box_cox transformation per time…
0
votes
1 answer

Adding all Year Month dates in a ggplot2 x-axis

Is there a way to show all dates in the x-axis? I have the following dataset and I wanted a ggplot in which in the x-axis I've year_month column, and in the y-axis the count column, BUT I wanted it to show all months in the scale, not just some as…
John P. S.
  • 367
  • 3
  • 17
0
votes
0 answers

how to apply boxcox for multiple series in tsibble

I would like to apply boxcox transformation for many series in tsibble data. Can't figure how to do it. require(fpp3) require(fpp) require(fable) require(tsibble) require(tsibbledata) require(feasts) require(ggplot2) require(lubridate) long =…
0
votes
1 answer

Mutate a column in a tsibble dataframe, applying a Box-Cox transformation

I am a big fan of Hyndman's packages, but stumbled with Box-Cox transformation. I have a dataframe class(chicago_sales) [1] "tbl_ts" "tbl_df" "tbl" "data.frame" I am trying to mutate an extra column, where the Mean_price variable…
Anakin Skywalker
  • 2,400
  • 5
  • 35
  • 63
0
votes
1 answer

'augment()' function in fabletools

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…
PiTao
  • 19
  • 4