0

Following my previous question with one product to forecast, lets say I have 5 products to forecast as in the following data:

 units_vector <- c(89496264,81820040,80960072,109164545,96226255,96270421,95694992,117509717,105134778,0)
library(data.table)
dt <- data.table('time' = rep(c(1:10),3),
                 'units'= c(units_vector,units_vector+runif(n = 10, max = 1000000),units_vector+runif(n = 10, max = 1000000)),
                 'product' = c(rep("A", 10),rep("B", 10),rep("C", 10))
)

I would like to forecast the units for time = 10 for all products.

I can see that at time = 4*k, where k = 1,2,... there is a big increase of units, and I would like to include that as a seasonality factor.

How could I do that in R ? Maybe with prophet ? Any other library or way will also do.

AlainD
  • 6,187
  • 3
  • 17
  • 31
quant
  • 4,062
  • 5
  • 29
  • 70

1 Answers1

0

You do the same: fit the model y = a*season + b with b = p(product) depending on the product and aequal for all products (if you assume the seasonality is the same for all products).

AlainD
  • 6,187
  • 3
  • 17
  • 31