g_bnp_sparse_means: Bayesian bootstrap-based transformation for sparse means

View source: R/helper_functions.R

g_bnp_sparse_meansR Documentation

Bayesian bootstrap-based transformation for sparse means

Description

Compute one posterior draw from the smoothed transformation implied by (separate) Bayesian bootstrap models for the CDFs of y and X. This function is for the special case of the sparse means model.

Usage

g_bnp_sparse_means(
  y,
  psi,
  pi_inc,
  zgrid = NULL,
  sigma_epsilon = 1,
  approx_Fz = FALSE
)

Arguments

y

n x 1 vector of observed counts

psi

prior variance for the slab component

pi_inc

prior inclusion probability

zgrid

optional vector of grid points for evaluating the CDF of z (Fz)

sigma_epsilon

latent standard deviation; set to one for identifiability

approx_Fz

logical; if TRUE, use a normal approximation for Fz, the marginal CDF of the latent z, which is faster and more stable

Value

A smooth monotone function which can be used for evaluations of the transformation at each posterior draw.


drkowal/rSTAR documentation built on July 5, 2023, 2:18 p.m.