max.window.width: Maximum Window Width for a Holiday

max.window.widthR Documentation

Maximum Window Width for a Holiday

Description

The maximum width of a holiday's influence window

Usage

## Default S3 method:
MaxWindowWidth(holiday, ...)
## S3 method for class 'DateRangeHoliday'
MaxWindowWidth(holiday, ...)

Arguments

holiday

An object of class Holiday.

...

Other arguments (not used).

Value

Returns the number of days in a holiday's influence window.

Author(s)

Steven L. Scott steve.the.bayesian@gmail.com

See Also

Holiday. AddRegressionHoliday. AddRandomWalkHoliday. AddHierarchicalRegressionHoliday.

Examples


easter <- NamedHoliday("Easter", days.before = 2, days.after = 1)
if (MaxWindowWidth(easter) == 4) {
  print("That's the right answer!\n")
}

## This holiday lasts two days longer in 2005 than in 2004.
may18 <- DateRangeHoliday("May18",
     start = as.Date(c("2004-05-17",
                       "2005-05-16")),
     end   = as.Date(c("2004-05-19",
                       "2005-05-20")))

if (MaxWindowWidth(may18) == 5) {
   print("Right again!\n")
}


bsts documentation built on May 29, 2024, 2:14 a.m.