| dca | R Documentation |
Functions implementing the Domain-Controlled Allocation (DCA) algorithm described in \insertCiteWesolowski;textualstratallo and \insertCiteWojciakPhD;textualstratallo. The algorithm solves the following optimum allocation problem, formulated in mathematical optimization terms:
Minimize
f(T,\, \boldsymbol x) = T
over \mathbb R \times \mathbb R_+^{\lvert \mathcal H \rvert},
subject to
\sum_{(d,h) \in \mathcal H} x_{d,h} = n,
\sum_{h \in \mathcal H_d} (\frac{1}{x_{d,h}} - \frac{1}{N_{d,h}}) \frac{N_{d,h}^2 S_{d,h}^2}{\rho_d^2} = T, \qquad d \in \mathcal D,
where:
(T,\, \boldsymbol x) = (T,\, (x_{d,h},\, (d,h) \in \mathcal H))the optimization variable,
\mathcal H \subset \mathbb N^2the set of domain-stratum indices,
\mathcal D := \{d \in \mathbb N \colon\; \exists h,\, (d,h) \in \mathcal H\}the set of domain indices,
\mathcal H_d := \{h \in \mathbb N \colon\; (d,h) \in \mathcal H\}the set of strata indices in domain d,
N_{d,h} > 0size of stratum (d,h),
S_{d,h} > 0standard deviation of the study variable in stratum (d,h),
\rho_d := t_d\, \sqrt{\kappa_d}where t_d denotes the total in domain d, i.e., the sum of the
values of the study variable for population elements in domain d,
and \kappa_d is a priority weight for domain d,
n \in (0,\, \sum_{(d,h) \in \mathcal H} N_{d,h}]total sample size.
dca0(n, H_counts, N, S, rho, rho2, details = FALSE)
dca(n, H_counts, N, S, rho, rho2, U = NULL, details = FALSE)
dca_nmax(H_counts, N, S)
n |
( |
H_counts |
( |
N |
( |
S |
( |
rho |
( |
rho2 |
( |
details |
( |
U |
( For example, if If
|
For n \in (0,\, n_{max}), the optimal value satisfies T^* > 0,
where
n_{max} := \sum_{d \in \mathcal D}
\frac{\bigl( \sum_{h \in \mathcal H_d} N_{d,h} S_{d,h} \bigr)^2}{\sum_{h \in \mathcal H_d} N_{d,h} S_{d,h}^2}.
See Proposition 2.1 in \insertCiteWesolowski;textualstratallo or
\insertCiteWojciakPhD;textualstratallo for details.
The value n_{max} is less than or equal to sum(N) and can be
computed with dca_nmax().
If details = FALSE, the optimal \boldsymbol x^* is returned.
Otherwise, a list is returned containing the optimal \boldsymbol x^*
(element named x) along with other internal details of this algorithm.
In particular, the lambda element of the list corresponds to the optimal
T^*.
dca0(): Domain-Controlled Allocation algorithm by
\insertCiteWesolowski;textualstratallo
dca(): Domain-Controlled Allocation algorithm by
\insertCiteWesolowski;textualstratallo, optionally using a set of
take-max strata as described in \insertCiteWojciakPhD;textualstratallo.
dca_nmax(): Computes the maximum total sample size n_{max} such that the
optimization problem solved by the Domain-Controlled Allocation (DCA)
algorithm admits a strictly positive optimal value T^*.
These functions are optimized for internal use and should typically not
be called directly by users. They are designed to handle a large number of
invocations, specifically recursive calls from rdca(), and, as a result,
parameter assertions are minimal.
WojciakPhDstratallo
\insertRefWesolowskistratallo
\insertRefWJWR2017stratallo
rdca()
# Two domains with 1 and 3 strata, respectively,
# that is, H = {(1,1), (2,1), (2,2), (2,3)}.
H_counts <- c(1, 3)
N <- c(140, 110, 135, 190) # (N_{1,1}, N_{2,1}, N_{2,2}, N_{2,3})
S <- sqrt(c(180, 20, 5, 4)) # (S_{1,1}, S_{2,1}, S_{2,2}, S_{2,3})
total <- c(2, 3)
kappa <- c(0.4, 0.6)
rho <- total * sqrt(kappa) # (rho_1, rho_2)
rho2 <- total^2 * kappa
sum(N) # 575
n_max <- dca_nmax(H_counts, N, S) # 519.0416
n <- floor(n_max) - 1
dca0(n, H_counts, N, S, rho, rho2)
x0 <- dca0(n, H_counts, N, S, rho, rho2, details = TRUE)
x0$x
x0$lambda
x0$k
x0$v
x0$s
n <- ceiling(n_max) + 1
x0 <- dca0(n, H_counts, N, S, rho, rho2, details = TRUE)
x0$x
x0$lambda
n <- floor(n_max) - 1
x1 <- dca(n, H_counts, N, S, rho, rho2, details = TRUE)
x1$x
x1$x_Uc
x1$lambda
x1$s
dca(n, H_counts, N, S, rho, rho2, U = 1)
x2 <- dca(n, H_counts, N, S, rho, rho2, U = 1, details = TRUE)
x2$x
x2$x_Uc
x2$lambda
x2$s
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.