Statistics computed within each calendar month across the whole record, mirroring the C#
MonthlySummaryStatistics, MonthlyPercentiles and MonthlyFrequency.
Usage
ts_monthly_statistics(ts)
ts_monthly_percentiles(ts, probabilities = c(0.05, 0.25, 0.5, 0.75, 0.95))
ts_monthly_frequency(ts)Value
a 12-row matrix (one row per calendar month), or a length-12 vector for
ts_monthly_frequency().
Details
A month with no observation keeps an all-zero row rather than a missing one, following the
library. The two functions differ in how they treat missing values, also following the library:
ts_monthly_statistics() filters them out, while ts_monthly_percentiles() does not, so one
missing value gives that month missing percentiles.
Examples
ts <- time_series(seq(as.Date("2000-01-01"), by = "month", length.out = 24), 1:24)
ts_monthly_statistics(ts)[1:3, ]
#> minimum p05 p25 p50 p75 p95 maximum mean
#> Jan 1 1.6 4 7 10 12.4 13 7
#> Feb 2 2.6 5 8 11 13.4 14 8
#> Mar 3 3.6 6 9 12 14.4 15 9