crimeClust_hier: Agglomerative Hierarchical Crime Series Clustering

Description Usage Arguments Details Value References See Also Examples

Description

Run hierarchical clustering on a set of crimes using the log Bayes Factor as the similarity metric.

Usage

1
2
crimeClust_hier(crimedata, varlist, estimateBF, linkage = c("average",
  "single", "complete"), ...)

Arguments

crimedata

data.frame of crime incidents. Must contain a column named crimeID.

varlist

a list of the variable names (columns of crimedata) used to create evidence variables with compareCrimes.

estimateBF

function to estimate the log bayes factor from evidence variables

linkage

the type of linkage for hierarchical clustering

  • “average” uses the average bayes factor

  • “single” uses the largest bayes factor (most similar)

  • “complete” uses the smallest bayes factor (least similar)

...

other arguments passed to compareCrimes

Details

This function first compares all crime pairs using compareCrimes, then uses estimateBF to estimate the log Bayes factor for every pair. Next, it passes this information into hclust to carry out the agglomerative hierarchical clustering. Because hclust requires a dissimilarity, this uses the negative log Bayes factor.

The input varlist is a list with elements named: crimeID, spatial, temporal, categorical, and numerical. Each element should be a vector of the column names of crimedata corresponding to that feature. See compareCrimes for more details.

Value

An object of class hclust (from hclust).

References

Porter, M. D. (2014). A Statistical Approach to Crime Linkage. arXiv preprint arXiv:1410.2285.. http://arxiv.org/abs/1410.2285

See Also

clusterPath, plot_hcc

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(crimes)
 #- cluster the first 10 crime incidents
 crimedata = crimes[1:10,]
 varlist = list(spatial = c("X", "Y"), temporal = c("DT.FROM","DT.TO"),
     categorical = c("MO1",  "MO2", "MO3"))
 estimateBF <- function(X) rnorm(NROW(X))   # random estimation of log Bayes Factor
 HC = crimeClust_hier(crimedata,varlist,estimateBF)
 plot_hcc(HC,yticks=-2:2)

 # See vignette: "Crime Series Identification and Clustering" for more examples.

crimelinkage documentation built on May 2, 2019, 1:36 a.m.