makePairs {crimelinkage} | R Documentation |
These functions generate a set of crimeIDs for linked and unlinked crime pairs.
Linked pairs are assigned a weight according to how many crimes are in the
crime series. For unlinked pairs, 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)
X |
crime series data (generated from |
thres |
the threshold (in days) of allowable time distance |
m |
the number of samples from each crime group (for unlinked pairs) |
show.pb |
(logical) should a progress bar be displayed |
seed |
seed for random number generation |
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.
matrix of indices of crime pairs with weights. For makePairs
,
The last column type
indicates if the crime pair is linked or unlinked.
data(crimes)
data(offenders)
seriesData = makeSeriesData(crimedata=crimes,offenderTable=offenders)
allPairs = makePairs(seriesData,thres=365,m=40)