When specifying custom holidays in the bsts
R package, I get the error
Error " .ValidateHolidayList(holiday.list) : all(sapply(holiday.list, inherits, "Holiday")) is not TRUE "
Same issue with the example in the vignette
.
How can I create a valid Holiday object ?
head(data)
A tibble: 6 x 2
Date tot
<date> <int>
1 2019-01-07 143
2 2019-01-08 133
3 2019-01-09 178
4 2019-01-10 140
5 2019-01-11 175
6 2019-01-12 255
holiday.name = "school_holidays"
start.date = as.Date(c("2019-01-01", "2019-03-04", "2019-04-08", "2019-07-01"))
end.date = as.Date(c("2019-01-06", "2019-03-10", "2019-04-22", "2019-08-05"))
holidays = DateRangeHoliday(holiday.name,
start.date,
end.date)
ss = AddRegressionHoliday(list(), data$tot, holiday.list = holidays)
Error in .ValidateHolidayList(holiday.list) :
all(sapply(holiday.list, inherits, "Holiday")) is not TRUE