1
$\begingroup$

I need to create a table with Holt-Winters Alpha, Beta and Gamma (ABG)

I have the following code

library(dplyr) 
library(lubridate) 
library(tibble) 
library(tidyverse)
library(psy)

read_file(sales1)

sales1 <- sales::sales(~date, ~sales,)
#Lag
sales1 = sales1 %>% mutate(lagsales = lag(sales))
rep(NA, rolling),   map_dbl((rolling + 1):nrow(sales1)

                            ts(sales, start = ymd("2017-03-01"), frequency = 2) -> sales_alpha

                            HoltWinters(sales_alpha) -> sales_hw

                            plot(sales_hw)

                            plot(fitted(sales_hw))
                            sales_hw

It pulls data from: file sales1

extract from Excel sales1 file :

Date    sales 
1983-01-01  25
1983-01-08  11
1983-01-15  8
2007-01-22  5
2007-01-29  8
2007-02-05  3
1983-02-12  10
2007-02-19  11
1983-02-26  11
1983-03-05  2
2019-03-12  11
1983-03-19  2
2019-03-26  21
1983-04-02  4
1983-04-09  20
2020-04-16  1
1983-04-23  3
2016-04-30  18
1983-05-07  2
2017-05-14  7

Who knows how to help me creating a table which generates a table with rolling ABG per 2 ongoing (sales ) variable ?

$\endgroup$
1
  • $\begingroup$ The question appears to focus on programming. If so, it is off topic. Otherwise, please clarify the statistical aspects of your question that you find problematic. $\endgroup$ Commented Apr 19, 2020 at 11:18

0