Learn R Programming

SequenceSpikeSlab (version 1.0.1)

Exact Bayesian Model Selection Methods for the Sparse Normal Sequence Model

Description

Contains fast functions to calculate the exact Bayes posterior for the Sparse Normal Sequence Model, implementing the algorithms described in Van Erven and Szabo (2021, ). For general hierarchical priors, sample sizes up to 10,000 are feasible within half an hour on a standard laptop. For beta-binomial spike-and-slab priors, a faster algorithm is provided, which can handle sample sizes of 100,000 in half an hour. In the implementation, special care has been taken to assure numerical stability of the methods even for such large sample sizes.

Copy Link

Version

Install

install.packages('SequenceSpikeSlab')

Monthly Downloads

229

Version

1.0.1

License

GPL (>= 2)

Maintainer

Tim van Erven

Last Published

September 8th, 2023

Functions in SequenceSpikeSlab (1.0.1)

SSS_hierarchical_prior

Compute marginal posterior probabilities (slab probabilities) that data points have non-zero mean for the hierarchical prior.
SSS_discretize_Lambda_beta

Given prior Lambda=Beta(kappa,lambda) on the alpha-parameter in the spike-and-slab model, make a discretized version of Lambda that is only supported on a grid of approximately m * sqrt(n) discrete values of alpha. This discretized version of Lambda is required as input for SSS_discrete_spike_slab.
SSS_hierarchical_prior_binomial

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.
SSS_discretize_Lambda

Given a prior Lambda on the alpha-parameter in the spike-and-slab model, make a discretized version of Lambda that is only supported on a grid of approximately m * sqrt(n) discrete values of alpha. This discretized version of Lambda is required as input for SSS_discrete_spike_slab. NB Lambda needs to satisfy a technical condition from the paper that guarantees its density does not vary too rapidly. For Lambda=Beta(kappa,lambda) use SSS_discretize_Lambda_beta instead.
SSS_postmean_Laplace

Compute posterior means of data points for the Laplace(lambda) slab
SSS_log_phi_psi_Cauchy

Calculate log of phi and psi marginal densities for Cauchy(gamma) slab
SSS_make_beta_grid

Creates a vector of uniformly spaced grid points in the beta parametrization Ensures the number of generated grid points is >= mingridpoints (which does not have to be integer), and that their number is always odd so there is always a grid point at pi/4.
SSS_discrete_spike_slab

Compute marginal posterior probabilities (slab probabilities) that data points have non-zero mean for the discretized spike-and-slab prior.
SSS_log_phi_psi_Laplace

Calculate log of phi and psi marginal densities for Laplace(lambda) slab
SSS_postmean_Cauchy

Compute posterior means of data points for the Cauchy(gamma) slab
general_sequence_model

Compute marginal posterior estimates
fast_spike_slab_beta

Compute marginal posterior estimates for beta-spike-and-slab prior
SequenceSpikeSlab-package

Fast Exact Bayesian Inference for the Sparse Normal Means Model