aorwt
Aoristic weights
aorwt( from, to, bw = 3600, nb = 168, origin = 259200, off = 0, tt = NULL, toff = NULL, lo = 120, hi = 604800, each = FALSE)Spreads each event known only to have happened in an interval [from, to) with uniform density over that interval and counts each instant in
the bin of its local clock time (Ratcliffe 2002): with the defaults, the
168 hours of the week from Sunday 00:00. A change of clock (daylight
saving) moves the remaining time to the right hours: skipped hours get
nothing and a repeated hour gets both. Missing values follow stated
rules: an event with no from is left out; with no to, a reversed
interval or one shorter than lo seconds, its whole weight goes to the
start’s bin; one of at least hi seconds is spread evenly over all bins.
Parameters
Section titled “Parameters”from, toThe start and end of each event’s interval: date-times (POSIXct) or seconds since 1970-01-01 UTC;
NAallowed as above, not infinite values.bwThe bin width in seconds, positive.
nbThe number of bins in a period: one whole number from 1.
originThe local clock time at which bin 1 starts, in the same units (the default is Sunday 1970-01-04 00:00).
offThe offset of the local clock from UTC in seconds, before
tt[1](for a fixed offset, the only one).tt, toffNULL, or the instants at which the local clock’s offset changes (strictly increasing) and the new offsets.lo, hiThe lengths in seconds below which an interval counts at its start and from which it counts everywhere,
0 <= lo < hi(lo = 0,hi = Infspread every interval exactly).eachTRUEto return each event’s weights.
Returns
Section titled “Returns”A list: tot (the summed weights by bin), w (NULL, or a
matrix with one row per event and one column per bin, rows summing to
1, 0 for events left out) and cnt (events left out, without end,
reversed, short and long).
References
Section titled “References”Ratcliffe, J. H. (2002). Aoristic signatures and the spatio-temporal analysis of high volume crime patterns. Journal of Quantitative Criminology, 18(1), 23-43. doi:10.1023/A:1013240828824
Examples
Section titled “Examples”f <- as.POSIXct(c("2024-03-04 22:00", "2024-03-05 09:30"), tz = "UTC")t <- as.POSIXct(c("2024-03-05 02:00", "2024-03-05 10:30"), tz = "UTC")a <- aorwt(f, t, bw = 3600, nb = 24, origin = 0)a$totGenerated from the R help page: aorwt in the R reference.