get.fraction function

Compute membership fractions

Compute membership fractions

Returns the fraction of days in a week that occur in the ear 1.0

GetFractionOfDaysInInitialMonth(week.ending) GetFractionOfDaysInInitialQuarter(week.ending)

Arguments

  • week.ending: A vector of class Date. Each entry contains the date of the last day in a week.

Returns

Returns a numeric vector of the same length as week.ending. Each entry gives the fraction of days in the week that occur in the coarse time interval (month or quarter) containing the start of the week (i.e the date 6 days before).

Author(s)

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

See Also

bsts.mixed.

Examples

dates <- as.Date(c("2003-03-31", "2003-04-01", "2003-04-02", "2003-04-03", "2003-04-04", "2003-04-05", "2003-04-06", "2003-04-07")) fraction <- GetFractionOfDaysInInitialMonth(dates) fraction == c(1, 6/7, 5/7, 4/7, 3/7, 2/7, 1/7, 1)
  • Maintainer: Steven L. Scott
  • License: LGPL-2.1 | MIT + file LICENSE
  • Last published: 2024-01-17

Useful links