Skip to contents

First-period counts \(y = \theta + e\) at places with true rates \(\theta\) and noise of variance noise_variance. The shrinkage estimator \((1-B)y + B\bar y\) has, under a noise law with weighted mean zero and zero weighted correlation with \(\theta\), the loss \((1-B)^2 S_e + B^2 S_\theta\) (Research.P19Shrinkage.loss_eq), minimised at \(B^* = S_e/(S_e + S_\theta)\) (loss_min, bstar_mem) where it never exceeds the raw loss (loss_bstar_le_raw). The predicted fall of a place is \(B(y - \bar y)\) (predicted_fall): the size the P19 sign theorem left open. Here \(S_\theta\) is estimated as the excess of the weighted scatter of \(y\) over the noise mass.

Usage

morie_hotspot_shrinkage(y, noise_variance, weights = NULL, B = NULL)

Arguments

y

First-period counts.

noise_variance

Noise variance \(\sigma^2\) (for Poisson counts, the mean count).

weights

Optional non-negative weights.

B

Optional shrinkage factor in \([0, 1]\); the default is \(B^*\).

Value

A list with mean, total_variance, noise_variance, signal_variance (\(\max(\text{total} - \sigma^2, 0)\)), B, shrunk, predicted_fall and theorems.

Examples

y <- c(40, 12, 9, 25, 7, 31, 5, 18)
s <- morie_hotspot_shrinkage(y, noise_variance = mean(y))
round(c(B = s$B, fall_top = s$predicted_fall[1], shrunk_top = s$shrunk[1]), 6)
#>          B   fall_top shrunk_top 
#>   0.132686   2.869344  37.130656