The close
R package implements the empirical Bayes posterior mean estimators developed
in Chen (2023).
library(devtools)
devtools::install_github("jiafengkevinchen/close")
Let
CLOSE assumes that
CLOSE proposes to estimate REBayes::GLmix
). The method CLOSE-Gauss assumes
The main function is compute_close
. The user may specify estimated local_linear_regression_conditional_moments
.
As an example
library(close) # Depends on REBayes and nprobust. In particular, REBayes require a MOSEK installation
set.seed(123)
n <- 10000
standard_errors <- 0.1 + runif(n)
# thetas are correlated with standard errors
thetas <- standard_errors + 0.3 * rnorm(n)
# Y ~ N(theta, sigma^2)
estimates <- thetas + standard_errors * rnorm(n)
# close_results$close_gauss contains estimated posterior means via CLOSE-Gauss
# close_results$close_npmle contains estimated posterior means via CLOSE-NPMLE
close_results <- compute_close(estimates, standard_errors)