Skip to contents

CsiWeights: incarceration rate times mean sentence in days. CrimeSeverityIndex: 100 R_t / R_base with R_t = sum_i w_i n_ti / P_t * per (Babyak et al. 2009). ULearnerCate: cross-fitted ridge outcome and logistic propensity models, pseudo-outcome (Y - m) / (D - e) regressed on X. RepeatedKfoldIndices: Philox permutations dealt to folds (0-based). FastIca: parallel FastICA with the log-cosh contrast after eigen-whitening. RstressMds: L-BFGS minimisation of sum w (delta - d^r)^2 from a classical-scaling start.

Usage

CsiWeights(incarceration_rate, mean_sentence_days)

CrimeSeverityIndex(counts, weights, population, base = 0, per = 1e+05)

ULearnerCate(y, d, X, folds = 5, l2 = 1, clip = 0.01, seed = 0)

RepeatedKfoldIndices(n, k = 10, repeats = 3, seed = 0)

FastIca(X, n_comp, w_init = NULL, alpha = 1, max_iter = 200, tol = 1e-04)

RstressMds(delta, r = 0.5, ndim = 2, weights = NULL, max_iter = 2000)

Arguments

incarceration_rate, mean_sentence_days

Offence-level rates and sentences.

counts

Periods by offence types counts.

weights

Offence weights, or MDS weights.

population

Populations per period.

base

Base period (0-based).

per

Rate multiplier.

y

Outcome.

d

Treatment indicator.

X

Covariates, or data matrix for FastIca.

folds, l2, clip

Cross-fitting folds, ridge penalty and propensity clip.

seed

Philox seed.

n, k, repeats

Sample size, folds and repeats.

n_comp

Number of components.

w_init

Initial unmixing matrix, or NULL for the identity.

alpha

Log-cosh constant.

max_iter, tol

Iteration limit and tolerance.

delta

Dissimilarity matrix.

r

rStress power.

ndim

Number of dimensions.

Value

A list or vector.

References

Babyak, C. et al. (2009). The methodology of the police-reported Crime Severity Index. SSC Proceedings. Kunzel, S. R. et al. (2019). PNAS 116, 4156-4165. Kuhn, M. and Johnson, K. (2013). Applied Predictive Modeling. Hyvarinen, A. (1999). IEEE Trans. Neural Networks 10, 626-634. de Leeuw, J., Groenen, P. J. F. and Mair, P. (2016). Minimizing rStress using majorization. UCLA.

Examples

CrimeSeverityIndex(rbind(c(10, 2), c(8, 3)), c(1, 50), c(1000, 1000))$index
#> [1] 100.0000 143.6364
RepeatedKfoldIndices(6, 3, 2)
#> [[1]]
#> [1] 0 1 2 2 1 0
#> 
#> [[2]]
#> [1] 2 1 0 1 0 2
#>