Hello everyone,
I am tryining to do a daily Forecast. For this I would like to determine a time series and both the training and test set. Unfortunately, however, the year 2016 is a leap year, so I cannot set the frequency to 365. To leave one day out of the examinations is also out of question, because afterwards the weekdays have to be analyzed. I already tried it with the frequency 365.25, but then the leap year would fall on the year 2018, which is not correct. The data has rather an annual cycle instead of a weekly one. However, I would be grateful for any solution suggestions. Enclosed my code so far:
inds <- seq(as.Date("2014-09-10"), as.Date("2017-12-31"), by = "day") # Create a daily Date object
historic_demand <- ts(data$Demand,
start = c(2014, as.numeric(format(inds[1], "%j"))),
frequency = 365)
training_set <- window(historic_demand,
start = c(2014, as.numeric(format(inds[1], "%j"))),
end = c(2016, 365))
test_set <- window(historic_demand,
start = c(2017, 1),
end = c(2017, 365))
Kind regards
Lukas