| rnabox | R Documentation |
Implements the Recursive Neyman Algorithm for Optimum Sample Allocation under Box Constraints (RNABOX), as proposed in \insertCiternabox;textualstratallo. The algorithm solves the following optimum allocation problem, formulated in mathematical optimization terms:
Minimize
f(x_1,\ldots,x_H) = \sum_{h=1}^H \frac{A^2_h}{x_h}
over \mathbb R_+^H, subject to
\sum_{h=1}^H x_h = n,
m_h \leq x_h \leq M_h, \qquad h = 1,\ldots,H,
where n > 0,\, A_h > 0,\, m_h > 0,\, M_h > 0, such that
m_h < M_h,\, h = 1,\ldots,H, and
\sum_{h=1}^H m_h \leq n \leq \sum_{h=1}^H M_h, are given numbers.
Inequality constraints are optional and may be omitted.
rnabox(
n,
A,
bounds_inner = NULL,
bounds_outer = NULL,
cmp_inner = .Primitive(">="),
cmp_outer = .Primitive("<=")
)
n |
(
|
A |
( |
bounds_inner |
( If both
|
bounds_outer |
( If both
|
cmp_inner |
(
The value of this argument has no effect if
|
cmp_outer |
(
The value of this argument has no effect if
|
A numeric vector of optimum sample allocations in strata.
The rnabox() function is optimized for internal use and should
typically not be called directly by users. Use opt() instead.
rnaboxstratallo
opt(), optcost(), rna(), sga(), sgaplus(), coma()
N <- c(454, 10, 116, 2500, 2240, 260, 39, 3000, 2500, 400)
S <- c(0.9, 5000, 32, 0.1, 3, 5, 300, 13, 20, 7)
A <- N * S
m <- c(322, 3, 57, 207, 715, 121, 9, 1246, 1095, 294) # lower bounds
M <- N # upper bounds
# Regular allocation.
n <- 6000
opt_regular <- rnabox(n, A, M, m)
# Vertex allocation.
n <- 4076
opt_vertex <- rnabox(n, A, M, m)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.