get_post_sample: Sample from posterior

View source: R/ashutility.R

get_post_sampleR Documentation

Sample from posterior

Description

Returns random samples from the posterior distribution for each observation in an ash object. A matrix is returned, with columns corresponding to observations and rows corresponding to samples.

Usage

get_post_sample(a, nsamp)

Arguments

a

the fitted ash object

nsamp

number of samples to return (for each observation)

Examples

beta = rnorm(100,0,1)
betahat= beta+rnorm(100,0,1)
ash.beta = ash(betahat,1,mixcompdist="normal")
post.beta = get_post_sample(ash.beta,1000)

stephens999/ashr documentation built on May 16, 2024, 3:10 a.m.