Hi, I am working on a hierarchical arima model to predict store transactions. The data is of tsibble format and I set key on store_nbr and family. The index is date. This morning I tried to fit the model and it gave NULL ARIMA MODELs. Then I contraint the dataset and tried to study on specific store_nbr and family. It showed an error of subscript out of bounds. could you give me some clue how to debug such problems? thanks!
The dataset looks like this:
trans_tbl1 <- trans_tbl %>%
filter(store_nbr %in% c(1) & family=='AUTOMOTIVE')
head(trans_tbl1)
the output is:
A grouped_ts: 6 × 8
Blockquote
|date|store_nbr|family|transactions|onpromotion|log.sales|sales|wday|
| --- | --- | --- | --- | --- | --- | --- | --- |
|||||||||
|2013-01-02|1|AUTOMOTIVE|2111|0.01|0.6931472|2.00|4|
|2013-01-03|1|AUTOMOTIVE|1833|0.01|1.0986123|3.00|5|
|2013-01-06|1|AUTOMOTIVE|520|0.01|0.6931472|2.00|1|
|2013-01-07|1|AUTOMOTIVE|1807|0.01|-4.6051702|0.01|2|
|2013-01-10|1|AUTOMOTIVE|1679|0.01|0.6931472|2.00|5|
|2013-01-15|1|AUTOMOTIVE|1680|0.01|0.0000000|1.00|3|
The model fitting is as:
model(trans_tbl1,
arima = ARIMA(transactions ~ onpromotion + wday +
pdq(2,1,0) + PDQ(1,1,1),
approximation=FALSE, order_constraint = p+q+P+Q <= 10,na.action=na.omit)
)
and it gave an error:
Error in
[[.default
(.data[[index_var(.data)]], 1): subscript out of bounds
Traceback:
- model(trans_tbl1, arima = ARIMA(transactions ~ onpromotion +
. wday + pdq(2, 1, 0) + PDQ(1, 1, 1), approximation = FALSE,
. order_constraint = p + q + P + Q <= 10, na.action = na.omit))- model.tbl_ts(trans_tbl1, arima = ARIMA(transactions ~ onpromotion +
. wday + pdq(2, 1, 0) + PDQ(1, 1, 1), approximation = FALSE,
. order_constraint = p + q + P + Q <= 10, na.action = na.omit))- eval_models(models, .data[["lst_data"]])
- map(models, function(model) {
. map(lst_data, estimate_progress, model)
. })- lapply(.x, .f, ...)
- FUN(X[[i]], ...)
- map(lst_data, estimate_progress, model)
- lapply(.x, .f, ...)
- FUN(X[[i]], ...)
- estimate(dt, mdl)
- fabletools::estimate(dt, null_model(!!f))
- estimate.tbl_ts(dt, null_model(!!f))
- .model$add_data(.data)
- .data[[index_var(.data)]][[1]]
[[.Date
(.data[[index_var(.data)]], 1)- .Date(NextMethod("[["), oldClass(x))
- NextMethod("[[")
Thanks!
Hi, I am working on a store transaction prediction problem. I converted the dataset into tsibble format. And try to predict store transactions depending on store number(store_nbr) and product categories (family).
`head(trans_df)`
gives:
```
A grouped_ts: 6 × 8|date|store_nbr|family|transactions|onpromotion|log.sales|sales|wday|
| --- | --- | --- | --- | --- | --- | --- | --- |
|<date>|<fct>|<fct>|<int>|<dbl>|<dbl>|<dbl>|<dbl>|
|2013-01-02|1|AUTOMOTIVE|2111|0.01|0.6931472|2.00|4|
|2013-01-03|1|AUTOMOTIVE|1833|0.01|1.0986123|3.00|5|
|2013-01-06|1|AUTOMOTIVE|520|0.01|0.6931472|2.00|1|
|2013-01-07|1|AUTOMOTIVE|1807|0.01|-4.6051702|0.01|2|
|2013-01-10|1|AUTOMOTIVE|1679|0.01|0.6931472|2.00|5|
|2013-01-15|1|AUTOMOTIVE|1680|0.01|0.0000000|1.00|3|
```
and I fit the model with the following codes:
```
fit <- trans_tbl %>%
model(
arima = ARIMA(transactions ~ onpromotion + wday +
pdq(2,1,0) + PDQ(1,1,1),
approximation=FALSE, order_constraint = p+q+P+Q <= 10)
)
fit
```
it showed all fitted models are null. Do you know what are the possibilities to cause an null model? Thanks!
```
A mdl_df: 6 × 3|store_nbr|family|arima|
| --- | --- | --- |
|<fct>|<fct>|<model>|
|1|AUTOMOTIVE|<NULL model>|
|1|BEAUTY|<NULL model>|
|1|BEVERAGES|<NULL model>|
|1|BREAD/BAKERY|<NULL model>|
|1|CELEBRATION|<NULL model>|
|1|CLEANING|<NULL model>|
```