Description Usage Arguments Details Value Author(s) References Examples
Generates samples of size k from DS(G,m) prior distribution.
1 2 3 4 | DS.sampler(k, g.par, LP.par, con.prior, LP.type, B)
DS.sampler.post(k, g.par, LP.par, y.0, n.0,
con.prior, LP.type, B)
|
k |
Total number of samples requested. |
g.par |
Estimated parameters for specified conjugate prior distribution (i.e beta prior: α and β; normal prior: μ and τ^2; gamma prior: α and β). |
LP.par |
LP coefficients for DS prior. |
con.prior |
The distribution type of conjugate prior g; either |
LP.type |
The type of LP means, either |
y.0 |
Depending on g, y_0 is either (i) the sample mean ( |
n.0 |
Depending on g, n_0 is either (i) the sample standard error ( |
B |
The number of grid points, default is 250. |
DS.sampler.post
uses the same type of sampling as DS.sampler
to generate random values from a DS posterior distribution.
Vector of length k containing sampled values from DS prior or DS posterior.
Doug Fletcher, Subhadeep Mukhopadhyay
Mukhopadhyay, S. and Fletcher, D., 2018. "Generalized Empirical Bayes via Frequentist Goodness of Fit," Nature Scientific Reports, 8(1), p.9983, https://www.nature.com/articles/s41598-018-28130-5.
Mukhopadhyay, S., 2017. "Large-Scale Mode Identification and Data-Driven Sciences," Electronic Journal of Statistics, 11(1), pp.215-240.
1 2 3 4 5 6 7 8 9 | ##Extracted parameters from rat.ds object
rat.g.par <- c(2.3, 14.1)
rat.LP.par <- c(0, 0, -0.5)
samps.prior <- DS.sampler(25, rat.g.par, rat.LP.par, con.prior = "Beta")
hist(samps.prior,15)
##Posterior for rat data
samps.post <- DS.sampler.post(25, rat.g.par, rat.LP.par,
y.0 = 4, n.0 = 14, con.prior = "Beta")
hist(samps.post, 15)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.