MyNixOS website logo
Description

Generalized Entropy Calibration.

Generalized Entropy Calibration produces calibration weights using generalized entropy as the objective function for optimization. This approach, as implemented in the 'GECal' package, is based on Kwon, Kim, and Qiu (2024) <doi:10.48550/arXiv.2404.01076>. Unlike traditional methods, 'GECal' incorporates design weights into the constraints to maintain design consistency, rather than including them in the objective function itself.

GECal

Generalized Entropy Calibration produces calibration weights based on generalized entropy as the objective function for optimization. In GECcal, design weights play a role in the constraints to ensure design consistency, rather than being part of the objective function.

Paper: Kwon, Y., Kim, J., & Qiu, Y. (2024). Debiased calibration estimation using generalized entropy in survey sampling. Submitted.

Installation

GECal is now available in CRAN. Use install.packages for installation.

install.packages("GECal")

The latest version of GECal can instead be installed using the package devtools.

install.packages("devtools") # Install "devtools" if it is unavailable.
devtools::install_github("yonghyun-K/GECal", dependencies = T)

Example commands

library(GECal)

set.seed(11)
N = 10000
x = data.frame(x1 = rnorm(N, 2, 1), x2= runif(N, 0, 4))
pi = pt((-x[,1] / 2 - x[,2] / 2), 3);
pi = ifelse(pi >.7, .7, pi)

delta = rbinom(N, 1, pi)
Index_S = (delta == 1)
pi_S = pi[Index_S]; d_S = 1 / pi_S
x_S = x[Index_S,,drop = FALSE]
# pimat = diag(d_S^2 - d_S) / N^2 # 1 / pi_i * (1 - 1 / pi_i)

e = rnorm(N, 0, 1)
y = x[,1] + x[,2] + e;
y_S = y[Index_S] # plot(x_S, y_S)

# Hajek estimator for population mean
calibration0 <- GECal::GEcalib(~ 1, dweight = d_S, data = x_S,
  const = 1, entropy = "SL", method = "DS")
GECal::estimate(y_S ~ 1, calibration = calibration0)$estimate 
# sum(y_S * d_S) / sum(d_S)

# Hajek estimator for population total
calibration0 <- GECal::GEcalib(~ 1, dweight = d_S, data = x_S,
  const = N, entropy = "SL", method = "DS")
GECal::estimate(y_S ~ 1, calibration = calibration0)$estimate 
# sum(y_S * d_S) * N / sum(d_S)

# HT estimator for population total
calibration <- GECal::GEcalib(~ 0, dweight = d_S, data = x_S,
  const = numeric(0), entropy = "SL", method = "DS")
GECal::estimate(y_S ~ 1, calibration = calibration)$estimate

# DS estimator using ET(exponential tilting) divergence
calibration1 <- GECal::GEcalib(~ ., dweight = d_S, data = x_S,
  const = colSums(cbind(1, x)), entropy = "ET", method = "DS")
GECal::estimate(y_S ~ 1, calibration = calibration1)$estimate

# GEC0 estimator using ET entropy
calibration2 <- GECal::GEcalib(~ ., dweight = d_S, data = x_S,
  const = colSums(cbind(1, x)),entropy = "ET", method = "GEC0")
GECal::estimate(y_S ~ 1, calibration = calibration2)$estimate

# GEC estimator using ET entropy 
# when the population total for log(d_S) is known.
calibration3 <- GECal::GEcalib(~ . + g(d_S), dweight = d_S, data = x_S,
  const = colSums(cbind(1, x, log(1 / pi))),
  entropy = "ET", method = "GEC")
GECal::estimate(y_S ~ 1, calibration = calibration3)$estimate

# GEC estimator using ET entropy 
# when the population total for log(d_S) is unknown.
calibration4 <- GECal::GEcalib(~ . + g(d_S), dweight = d_S, data = x_S,
  const = colSums(cbind(1, x, NA)),
  entropy = "ET", method = "GEC")
GECal::estimate(y_S ~ 1, calibration = calibration4)$estimate

# GEC estimator using ET entropy using different K_alpha
# when the population total for log(d_S) is unknown.
calibration5 <- GECal::GEcalib(~ . + g(d_S), dweight = d_S, data = x_S,
  const = colSums(cbind(1, x, NA)),
  entropy = "ET", method = "GEC", K_alpha = "log")
GECal::estimate(y_S ~ 1, calibration = calibration5)$estimate

Externel Links

-- CRAN Task View: Official Statistics & Survey Statistics: 4.1 Weighting and Calibration

Metadata

Version

0.1.5

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows