# Sampling - optimal allocation for quantiles?

Say we have variable with a typical heavy tailed distribution following the Pareto principle. We divide the population into two strata (following the 80 / 20 rule) and use a stratified sampling design to estimate functionals of the variables of interest, with maximum precision.

For the mean, the optimal stratified design uses the Neyman allocation, which is in the order of 2% / 98%:

library(rmutil)

set.seed(42)
N <- 10000
Y <- rpareto(N, 10, 1.25)

## Distribution follows pareto principle
q80 <- quantile(Y, 0.80)

stratum <- rep(1, N)
stratum[Y >= q80] <- 2
sum(Y[stratum == 2]) / sum(Y)
# [1] 0.8282522

## Optimal allocation
neyman_allocation_pct <- function(Y, stratum) {

H <- length(unique(stratum))
S2 <- rep(0, H)
Nh <- rep(0, H)

for(k in 1:H) {
Nh[k] <- length(Y[stratum == k])
S2[k] <- 1/(Nh[k] - 1)*var(Y[stratum == k])
}

denom <- sum( sqrt(S2) * Nh )

return( sqrt(S2) * Nh / denom )
}

neyman_allocation_pct(Y, stratum)
# [1] 0.02739706 0.97260294


Say we now want to estimate some quantiles of the variable of interest. What is the optimal allocation?

Surely, the optimal allocation for the median for example is much more "balanced" than the Neyman allocation. Is there literature on how it varies precisely depending on the quantile, and how it compares to the optimal allocation for the mean?