DS.sampler {BayesGOF} | R Documentation |
Samples data from DS(G,m) distribution.
Description
Generates samples of size k
from DS(G,m)
prior distribution.
Usage
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)
Arguments
k |
Total number of samples requested. |
g.par |
Estimated parameters for specified conjugate prior distribution (i.e beta prior: |
LP.par |
LP coefficients for DS prior. |
con.prior |
The distribution type of conjugate prior |
LP.type |
The type of LP means, either |
y.0 |
Depending on |
n.0 |
Depending on |
B |
The number of grid points, default is 250. |
Details
DS.sampler.post
uses the same type of sampling as DS.sampler
to generate random values from a DS posterior distribution.
Value
Vector of length k
containing sampled values from DS prior or DS posterior.
Author(s)
Doug Fletcher, Subhadeep Mukhopadhyay
References
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.
Examples
##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)