benchmark_bayesest: Benchmark posterior draws via a constrained Bayes estimator...

View source: R/benchmark_bayesest.R

benchmark_bayesestR Documentation

Benchmark posterior draws via a constrained Bayes estimator approach

Description

Benchmarks draws from a distribution using the method described in the paper "Bayesian benchmarking with applications to small area estimation" by G.S. Datta, M. Ghosh, R. Steorts, and J. Maples. Takes in a matrix of posterior draws, and national-level benchmark data.

Usage

benchmark_bayesest(
  posterior_samps,
  nregion = NA,
  ntime = 1,
  natl,
  pop_weights = NA
)

Arguments

posterior_samps

a matrix containing posterior draws at the area-level. Rows should be arranged in order arrange(region, time), with each column containing an independent draw from the posterior.

nregion

the number of regions you have estimates for. Defaults to the number of rows in posterior_samps.

ntime

the number of time points you have estimates for. Defaults to 1.

natl

a vector of national level estimates, arranged in order of time if you have multiple time points in your data.

pop_weights

a vector of population weights for use in the benchmarking constraint. Must sum to one at each time point, and be in order arrange(region, time)

Value

A matrix of benchmarked samples in order arrange(region, time)

Author(s)

Taylor Okonek


taylorokonek/stbench documentation built on Jan. 7, 2025, 11:13 p.m.