Hello
I am trying to get values like ETS forecast , alpha , beta and gamma values, based on previous 20 observations. All in a simple table.Thats all. I ve been using lots of examples on this forum ,but none worked.
Is there anyone who can advise me on the code?
I ve been busy now for 3 months ,but so far unsuccessful ;-(
reprex:
# load needed packages
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) # necessary to use forecasting methods
#> as.zoo.data.frame zoo
#> Loading required package: smooth
library (ggplot2)
# import data
sales <- read_excel("C:/Users/jenny/Desktop/R Studio/MonthlySales1.xls")
#> New names:
#> * `` -> ...7
#> * `` -> ...8
fit <- Arima(sales,c(3,1,0))
#> Error in stats::arima(x = x, order = order, seasonal = seasonal, include.mean = include.mean, : only implemented for univariate time series
plot(forecast(fit))
#> Error in forecast(fit): object 'fit' not found
sales
#> # A tibble: 95 x 8
#> Month sales `ETS Forecast` `Hw -alpha` `Hw-beta` `Hw-gamma` ...7 ...8
#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 january 43 NA NA NA NA NA NA
#> 2 february 48 NA NA NA NA NA NA
#> 3 march 47 NA NA NA NA NA NA
#> 4 april 48 NA NA NA NA NA NA
#> 5 may 48 NA NA NA NA NA NA
#> 6 june 49 NA NA NA NA NA NA
#> 7 july 38 NA NA NA NA NA NA
#> 8 august 25 NA NA NA NA NA NA
#> 9 september 48 NA NA NA NA NA NA
#> 10 october 48 NA NA NA NA NA NA
#> # ... with 85 more rows
Created on 2020-05-15 by the reprex package (v0.3.0)
the excel file looks like this:
MonthlySales1.xls")
Month sales ETS Forecast Hw -alpha Hw-beta Hw-gamma
january 43
february 48
march 47
april 48
may 48
june 49
july 38
august 25
september 48
october 48
november 39
december 49
january 41
february 35
march 43
april 47
may 39
june 49
july 37
august 46
september 31
october 45
november 26
december 24
january 48
february 32
march 47
april 49
may 48
june 45
july 43
august 47
september 43
october 27
november 43
december 49
january 48
february 46
march 47
april 34
may 35
june 49
july 42
august 49
september 49
october 43
november 48
december 49
january 47
february 44
march 33
april 46
may 39
june 43
july 49
august 45