$$ \hat{\lambda} = \frac{N_{rec}/q}{\hat{\mu} N_{neg}} $$ where \(\hat{\mu}\) is an estimate of the mean window period.

estSnapshot(n_r, n_n, n_p, n, mu, mu_var, n_p_test = NULL)

Arguments

n_r

Number of recent positives

n_n

Number of negatives

n_p

Number of positives

n

Total number of observations (\(n_n + n_p = n\))

mu

Mean window period (in years, not days)

mu_var

Variance of the estimator for mean window period. If \(\mu\) is known, input 0.

n_p_test

Optional number of positives that were given a recency test. If left NULL, assumed to be equal to n_p.

Value

Returns a list of the estimate and the variance for \(\lambda\).

Details

q is an adjustment for the number of positives that are given recency tests.

Examples

estSnapshot(n_r=2, n_n=50, n_p=10, n=60,
             mu=0.36, mu_var=0)
#> $est
#> [1] 0.1111111
#> 
#> $var
#> [1] 0.006419753
#> 
estSnapshot(n_r=c(2, 3), n_n=c(50, 48), n_p=c(10, 12), n=c(60, 60),
             mu=0.36, mu_var=0, n_p_test=c(9, 10))
#> $est
#> [1] 0.1234568 0.2083333
#> 
#> $var
#> [1] 0.00775627 0.01464844
#>