m
crimes are selected from each
crime group and pairs them with crimes in other crime groups.
makePairs(X, thres = 365, m = 40, show.pb = FALSE, seed = NULL)
makeLinked(X, thres = 365)
makeUnlinked(X, m, thres = 365, show.pb = FALSE, seed = NULL)
makeSeriesData
)
with offender ID (offenderID
),
crime ID (crimeID
), and the event datetime (TIME
)makePairs
,
The last column type
indicates if the crime pair is linked or unlinked.
makePairs
is a Convenience function that calls makeLinked
and
makeUnlinked
and combines the results. It is unlikely that the latter
two functions will need to be called directly.For linked crime pairs, the weights are such that each crime series contributes a total weight of no greater than 1. Specifically, the weights are $W_{ij} = \min \{1/N_m: V_i,V_j \in C_m \}$, where $C_m$ is the crime series for offender $m$ and $N_m$ is the number of crime pairs in their series (assuming $V_i$ and $V_j$ are together in at least one crime series). Due to co-offending, the sum of weights will be smaller than the number of series with at least two crimes.
To form the unlinked crime pairs, crime groups are identified
as the maximal connected offender subgraphs. Then m
indices are drawn
from each crime group (with replacment) and paired with crimes from other crime groups according
to weights that ensure that large groups don't give the most events.
data(crimes)
data(offenders)
seriesData = makeSeriesData(crimedata=crimes,offenderTable=offenders)
allPairs = makePairs(seriesData,thres=365,m=40)
Run the code above in your browser using DataLab