  The optimum sample allocation in stratified sampling is one of the basic
issues of survey methodology. It is a procedure of dividing the overall sample
size into strata sample sizes in such a way that for given sampling designs in
strata the variance of the stratified $\pi$ estimator of the population total
(or mean) for a given study variable assumes its minimum. In this work, we
consider the optimum allocation of a sample, under lower and upper bounds
imposed jointly on sample sizes in strata. We are concerned with the variance
function of some generic form that, in particular, covers the case of the
simple random sampling without replacement in strata. The goal of this paper is
twofold. First, we establish (using the Karush-Kuhn-Tucker conditions) a
generic form of the optimal solution, the so-called optimality conditions.
Second, based on the established optimality conditions, we derive an efficient
recursive algorithm, named RNABOX, which solves the allocation problem under
study. The RNABOX can be viewed as a generalization of the classical recursive
Neyman allocation algorithm, a popular tool for optimum allocation when only
upper bounds are imposed on sample strata-sizes. We implement RNABOX in R as a
part of our package stratallo which is available from the Comprehensive R
Archive Network (CRAN) repository.
