getNonZeros: Compute Non-Zeros (Signals)

View source: R/helper_functions.R

getNonZerosR Documentation

Compute Non-Zeros (Signals)

Description

Estimate the location of non-zeros (signals) implied by horseshoe-type thresholding.

Usage

getNonZeros(post_evol_sigma_t2, post_obs_sigma_t2 = NULL)

Arguments

post_evol_sigma_t2

the Nsims x T or Nsims x T x p matrix/array of posterior draws of the evolution error variances.

post_obs_sigma_t2

the Nsims x 1 or Nsims x T matrix of posterior draws of the observation error variances.

Details

Thresholding is based on kappa[t] > 1/2, where kappa = 1/(1 + evol_sigma_t2/obs_sigma_t2), evol_sigma_t2 is the evolution error variance, and obs_sigma_t2 is the observation error variance. In particular, the decision rule is based on the posterior mean of kappa.

Value

A vector (or matrix) of indices identifying the signals according to the horsehoe-type thresholding rule.

Note

The thresholding rule depends on whether the prior variance for the state variable mu (i.e., evol_sigma_t2) is scaled by the observation standard deviation, obs_sigma_t2. Explicitly, if mu[t] ~ N(0, evol_sigma_t2[t]) then the correct thresholding rule is based on kappa = 1/(1 + evol_sigma_t2/obs_sigma_t2). However, if mu[t] ~ N(0, evol_sigma_t2[t]*obs_sigma_t2[t]) then the correct thresholding rule is based on kappa = 1/(1 + evol_sigma_t2). The latter case may be implemented by omitting the input for post_obs_sigma_t2 (or setting it to NULL).


dsp documentation built on Aug. 21, 2025, 5:29 p.m.