Command Reference : Function Reference : Function Reference: H
  
 
@holiday
Holiday identifier for observation.
Syntax: @holiday(h[, b][, flag...])
h: string
b: (optional) string
flag: (optional) string
Return: series
where h is the holiday event specification, b is a basis specification, and flag is a calculation scaling flag.
Returns the proportion or identifier of an annual event covered by the observation, for each observation in the workfile.
@holiday is similar to @holidayset, but allows for the specification of holidays using a range pair of dates, while disallowing multiple holiday event specifications.
Event Specification
The h specification identifies holiday events using date specifications of the form:
"base[~|!][(offset)][[weights]]"
where the base component consists of a single date, a pair of dates (forming a range), or a single or a named group of holidays:
A single date consists of either a non-space delimited day day-of-the-month specification (e.g., “Dec25”), an n‑th-weekday-of-the-month specification (e.g., “Nov4Thu” for the fourth Thursday in November or “May-1Mon” for the last Monday in May, using negative values for the last weekday in month, or a named holiday ( “Named Holidays”).
Multiple dates may be specified using a date range (e.g., “Dec25 Jan05” and “Nov4Thu May-1Mon”), or a named group of holidays ( Named Groups).
The remainder of the specification consists of optional settings. The base component specification may be followed by any of the following options:
a weekend modifier ( “Modifiers”).
a parenthetical offset ( “Offsets”).
a bracketed list of weights ( “Weights”).
For a base consisting of a range pair of dates, optional settings may be provided for both the start and end dates.
For a base consisting of a named group, the optional settings will be applied to each of the individual members of the group.
Named Holidays
EViews supports named holidays for common holidays in the G8 countries, including the following ecclesiastical holidays: “epiphany”, “easterfriday”, “goodfriday”, “easter”, “eastermonday”, “ascension”, “pentecost”, “whitmonday”, “assumption”, “allsaints”, “immaculate”, “christmas”, “saintstephen.
Also available are New Years Day (“nyd”, “newyear”, and “newyears”), Lunar New Year (“cny”, “lny”, and “lunarnewyear”), International Women’s Day (“women” and “womens”), and International Men’s Day (“men” and “mens”).
Named holidays primarily associated with a specific country are suffixed with a locale code following ISO 3166-1 alpha-2, i.e., the Internet country codes for top-level domains such as “.ca” and “.de”. These named holidays are:
Canada – “victoria.ca”, “discovery.ca”, “canada”, “civic.ca”, “labour.ca”, “thanksgiving.ca” (also“thanks.ca”), “remembrance.ca”, “boxing.ca”
France – “labour.fr”, “victory.fr”, “bastille.fr”, “armistice.fr”
Germany – “labour.de”, “unity.de”
Italy – “liberation.it”, “labour.it”, “republic.it”
Russia – “christmas.ru”, “defender.ru”, “springlabour.ru”, “victory.ru”, “russia”, “unity.ru”
United Kingdom – “mayday.uk”, “springbank.uk”, “summerbank.uk”, “boxing.uk”
United States of America – “mlk.us”, “presidents.us”, “memorial.us”, “independence.us”, “labor.us”, “columbus.us”, “veterans.us”, “thanksgiving” (also “thanks”)
Note that the named holidays “canada”, “russia”, and “thanksgiving” do not include a suffix, either to avoid redundancy or maintain compatibility with earlier versions of EViews. Also note that “christmas.ru” is included to reflect the Russian Orthodox Church’s use of the Julian calendar.
In general, a suffix may be safely added to any named holiday that does not already include one, e.g. “christmas.us” or “nyd.it”. Unless noted above, such combinations do not alter the nominal date of the holiday but may produce different results when combined with a weekend modifier ( “Modifiers”).
Named Groups
Named groups are preset collections of holidays. EViews currently supports a single named group, “bank”, for each of the supported locales, i.e., “bank.ca”, “bank.fr”, “bank.de”, etc., allowing easy access to the common bank holidays.
The membership of these groups are:
Canada, “bank.ca” – “nyd goodfriday victoria discovery canada civic labour thanksgiving remembrance christmas boxing”
France, “bank.fr” –“ nyd eastermonday labour victory ascension whitmonday bastille assumption allsaints armistice christmas”
Germany, “bank.de” – “nyd goodfriday eastermonday labour ascension whitmonday unity christmas saintstephen”
Italy, “bank.it” – “nyd epiphany easter eastermonday liberation labour republic assumption allsaints immaculate christmas saintstephen”
Russia, “bank.ru” – “nyd christmas defender womens springlabour victory russia unity”
United Kingdom, “bank.uk” – “nyd goodfriday eastermonday mayday springbank summerbank christmas boxing”
United States of America, “bank.us” – “nyd mlk presidents memorial independence labor columbus veterans thanksgiving christmas”
All named group members have an implied suffix matching the group’s suffix. When using a named group, the sum of proportion values within a year will equal the number of group members (ignoring sample effects).
Modifiers
A weekend modifier character “~” or “!” indicates special handling of dates that fall on weekends.
If “~” is used, then the date will be adjusted to the nearest weekday. A date landing on a Saturday is adjusted to the preceding Friday, and a date landing on a Sunday is adjusted to the following Monday.
If “!” is used with a named holiday, then a more sophisticated set of rules is used to determine when the holiday will be observed, reflecting public holiday and bank holiday conventions.
In some locales, holidays are observed according to the simple rule encapsulated by the “~” modifier and thus the two modifiers will behave identically. For example, suppose we are evaluating “christmas.us!” for the year 2021. That date lands on a Saturday and the holiday will be observed on the preceding Friday, Dec. 24. However, if evaluating “christmas.uk!” for the same year, weekend holidays are observed on the nearest following weekday in this locale, thus the holiday will be observed on Monday, Dec. 27. Similarly, “boxing.uk!” will be observed on Tuesday, Dec. 28.
Offsets
A date followed by a parenthetical offset will be adjusted by the given number of days. For example, “christmas(-1)” could be used to specify Christmas Eve. If a weekend modifier is also present, e.g. “christmas~(-1)”, the offset is applied after any adjustment made by the modifier.
Basis
The optional basis parameter may be used to specify that only certain days of the week or times of the day should be included as part of the holiday. This parameter has the format
"start_weekday-end_weekday[, start_time-end_time]"
e.g. “mon-thu” or “mon-sun,10am-4pm”.
Weights
A date followed by a bracketed list of weights is considered to occur over multiple days. The specified weights determine the relative proportion of the holiday occurring on each day, with the sum of proportions across all days within a year equaling one. The list must contain an odd number of terms, with the middle term corresponding to the nominal date of the holiday (after adjustment from any weekend modifier or offset).
For example, evaluating “christmas” for a daily workfile would return the value 1 for the observation on Dec. 25 and the value 0 for all other observations in that year. Evaluating “christmas[1,2,1]” would return the value 0.25 for the observation on Dec. 24, the value 0.5 for Dec. 25, and the value 0.25 for Dec. 26, returning the value 0 for all other observations.
Several named weight patterns are available as alternatives to explicit weight lists:
“rampup(n)” – An increasing integer sequence of length ending on the date. For example, “[rampup(3)]” is equivalent to “[1,2,3,0,0]”.
“rampdown(n)” – A decreasing integer sequence of length beginning on the date. For example, “[rampdown(3)]” is equivalent to “[0,0,3,2,1]”.
“ramp(n)” –An increasing and then decreasing integer sequence centered on the date. For example, “[ramp(3)]” is equivalent to “[1,2,3,2,1]”.
Note that weights may not be included when a pair of dates is used to specify a range.
Flag
The optional flag parameter supports two options, “binary” and “denorm”.
If “binary” is specified, any non-zero value that would be returned is replaced by one, thus forcing the function to return only zeros and ones. This flag is equivalent to the expression “@holiday(...)>0”.
If “denorm” is specified, then the default normalization steps for weighted dates (dividing by the sum of weights) and sets or groups of holidays (dividing by the number of distinct holidays) are not performed.
For example, @holiday("christmas[1,2,1]") returns values 0.25, 0.5, and 0.25 on sequential observations around Christmas, whereas @holiday("christmas[1,2,1]", "denorm") would return values 1, 2, and 1.
Examples
@holiday("Jan1")
@holiday("Veterans.us(7)Thanksgiving.us")
@holiday("NewYears[1,2,0]")
Cross-references
See “Holiday Functions” for extensive discussion. See also @holidayset.