
Error of the empirical-Bayes shrinkage factor when the total mass is estimated
Source:R/ledger_1_4_3.R
morie_shrinkage_factor_error.RdThe 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.
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"
#>