Skip to contents

The factor \(B^* = S_e / S_y\) needs the total mass \(S_y = S_e + S_\theta\) (Research.P19Error.bstar_from_total), estimated from the same counts. The plug-in \(\hat B = S_e/\hat S_y\) is off by \(S_e (S_y - \hat S_y)/(S_y \hat S_y)\) (bhat_error), at most \(B^* |\hat S_y - S_y| / \hat S_y\) (bhat_error_bound), and the predicted fall of a place inherits the same error times its excess over the mean (fall_error). Given the counts, the total mass is estimated by their weighted variance and its uncertainty by the leave-one-out jackknife.

Usage

morie_shrinkage_factor_error(
  y,
  noise_variance,
  weights = NULL,
  total_variance = NULL
)

Arguments

y

Counts, one per place.

noise_variance

The stated noise mass \(S_e\) (for Poisson counts, the mean).

weights

Optional non-negative weights.

total_variance

Optional true total mass, when known, to evaluate the exact error.

Value

A list with B_hat, S_y_hat, S_y_se (jackknife), B_interval (the factor at \(\hat S_y \pm 2\) se, by bhat_antitone), error_bound (the bound at the 2-se relative error), and, with total_variance, error and bound_holds.

Examples

set.seed(1)
y <- rpois(40, 6)
morie_shrinkage_factor_error(y, noise_variance = mean(y))
#> $B_hat
#> [1] 1.081081
#> 
#> $S_y_hat
#> [1] 5.619375
#> 
#> $S_y_se
#> [1] 1.43364
#> 
#> $B_interval
#>     lower     upper 
#> 0.7158297 2.2074098 
#> 
#> $error_bound
#> [1] 0.5516206
#> 
#> $theorem
#> [1] "Research.P19Error.bhat_error_bound"
#>