The partial-pooling model can be seen as a compromise between the extremes of the no-pooling and partial-pooling models. We do not treat all observed data as coming from a homogeneous source, but we do assume that information on other units can be useful for estimating theta_i of a particular unit i, especially when there is little information for a particular unit i.

theta_partpool(n, y, beta = 0.376, random_seed = 200731)

Arguments

n

Previous reference count values (measure of exposure), must at least be 1

y

Previous count values of interest

beta

Parameter for half-normal distribution of alpha (default: 0.376, so that the expected value of alpha is 0.3)

random_seed

Seed value for Stan (default: 200731)

Value

Partial-pooling estimates of theta

Details

The partial-pooling model uses a hierarchical structure of probability distributions. We will use the same types of distributions for this model that we used for simulating the data.

In particular, we assume that each observational unit i has a Poisson distribution with parameter lambda_i. lambda_i is a product of a rate parameter theta_i and the exposure n_i.

We use a half-normal distribution with a parameter alpha for the rate parameters theta_i. This time, alpha itself is also assumed to have a probability distribution. We choose a half-normal distribution with a parameter beta. By default, beta is set to 0.376, so that the expected value of alpha is 0.3.

Note that when simulating the data we set alpha to 0.05. The "true" value of alpha is substantially lower than the default value initially assumed by our model.

Given data in the form of reference counts n_i (exposure) and count values of interest y_i, our model will allow us to determine a posterior probability distribution both for the parameter alpha and for the rate parameters theta_i.

We will use the mean of the theta samples drawn from the posterior distribution as the partial pooling estimate for theta.

This function prints diagnostic information as a side effect.