SSS_hierarchical_prior_binomial: Compute marginal posterior probabilities (slab probabilities)...

View source: R/SequenceSpikeSlab.R

SSS_hierarchical_prior_binomialR Documentation

Compute marginal posterior probabilities (slab probabilities) that data points have non-zero mean using the general hierarchical prior algorithm, but specialized to the Beta[kappa,lambda]-binomial prior. This function is equivalent to calling SSS_hierarchical_prior with logprior = lbeta(kappa+(0:n),lambda+n-(0:n)) - lbeta(kappa,lambda) + lchoose(n,0:n), but more convenient when using the Beta[kappa,lambda]-binomial prior and with a minor interior optimization that avoids calculating the choose explicitly.

Description

Compute marginal posterior probabilities (slab probabilities) that data points have non-zero mean using the general hierarchical prior algorithm, but specialized to the Beta[kappa,lambda]-binomial prior. This function is equivalent to calling SSS_hierarchical_prior with logprior = lbeta(kappa+(0:n),lambda+n-(0:n)) - lbeta(kappa,lambda) + lchoose(n,0:n), but more convenient when using the Beta[kappa,lambda]-binomial prior and with a minor interior optimization that avoids calculating the choose explicitly.

Usage

SSS_hierarchical_prior_binomial(
  log_phi_psi,
  kappa,
  lambda,
  show_progress = TRUE
)

Arguments

log_phi_psi

List {logphi, logpsi} containing two vectors of the same length n that represent a preprocessed version of the data. logphi and logpsi should contain the logs of the phi and psi densities of the data points, as produced for instance by SSS_log_phi_psi_Laplace or SSS_log_phi_psi_Cauchy

kappa

First parameter of the beta-distribution

lambda

Second parameter of the beta-distribution

show_progress

Boolean that indicates whether to show a progress bar

Value

Returns a vector with marginal posterior slab probabilities that x[i] has non-zero mean for i=1,...,n.


SequenceSpikeSlab documentation built on Sept. 8, 2023, 6:06 p.m.