Moving Holtwinters values

 Hi fellow forum members. Is there anyone who knows how I can get : 
moving ' Holtwinters values behind my Sales numbers in a matrix.
I have cumulative Holtwinters values already , so the Holtwinters formula needs tweaking to select every time a moving range of  20 sales-observations. A separate matrix would work as well ,i could Cbind that.

Reprex:  

library(readr)
library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
library(readxl)
library(forecast) 
#> Registered S3 method overwritten by 'quantmod':
#>   method            from
#>   as.zoo.data.frame zoo
library (ggplot2)
library(tidyr)
library(stats)

sales=  c (6,5,18,8, 43,61,6,5,18,8, 43,61,6,5,18,8, 43,61,6,5,18,8, 43,61)
salesLogHW <- HoltWinters(salesLog)
HoltWinters(x= salesLog)
spread(HoltWinters(nextYearSales))

#Created on 2020-05-22 by the reprex package (v0.3.0)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.