weighted_calendar: Create a Composite Calendar

View source: R/calendars.R

weighted_calendarR Documentation

Create a Composite Calendar

Description

Allows to combine two or more calendars into one calendar, weighting all the holidays of each of them.

Usage

weighted_calendar(calendars, weights)

Arguments

calendars

list of calendars.

weights

vector of weights associated to each calendar.

Details

Composite calendars are useful for a series that including data from more than one country/region. They can be used, for example, to create the calendar for the European Union or to create the national calendar for a country, in which regional holidays are celebrated. For example, in Germany public holidays are determined by the federal states. Therefore, Epiphany is celebrated only in Baden-Wurttemberg, Bavaria and in Saxony-Anhalt, while from 1994 Day of Repentance and Prayer is celebrated only in Saxony.

Value

returns an object of class c("JD3_WEIGHTEDCALENDAR","JD3_CALENDARDEFINITION")

References

More information on calendar correction in JDemetra+ online documentation: https://jdemetra-new-documentation.netlify.app/a-calendar-correction

See Also

national_calendar, chained_calendar

Examples

Belgium <- national_calendar(list(special_day("NEWYEAR"), fixed_day(7, 21)))
France <- national_calendar(list(special_day("NEWYEAR"), fixed_day(7, 14)))
composite_calendar <- weighted_calendar(list(France, Belgium), weights = c(1, 2))

palatej/rjd3toolkit documentation built on Oct. 30, 2024, 10:46 p.m.