DS.macro.inf {BayesGOF} | R Documentation |
Execute MacroInference (mean or mode) on a DS object
Description
A function that generates macro-estimates with their uncertainty (standard error).
Usage
DS.macro.inf(DS.GF.obj, num.modes = 1,
method = c("mean", "mode"),
iters = 25, exposure = NULL)
Arguments
DS.GF.obj |
Object from |
num.modes |
The number of modes indicated by |
method |
Returns mean or mode(s) (based on user choice) along with the associated standard error(s). |
iters |
Integer value of total number of iterations. |
exposure |
In the case where |
Value
DS.GF.macro.obj |
Object of class |
model.modes |
For |
mode.sd |
For |
boot.modes |
For |
model.mean |
For |
mean.sd |
For |
boot.mean |
For |
prior.fit |
Fitted values of estimated prior imported from the |
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.
Examples
## Not run:
### MacroInference: Mode
data(rat)
rat.start <- gMLE.bb(rat$y, rat$n)$estimate
rat.ds <- DS.prior(rat, max.m = 4, rat.start. family = "Binomial")
rat.ds.macro <- DS.macro.inf(rat.ds, num.modes = 2, method = "mode", iters = 5)
rat.ds.macro
plot(rat.ds.macro)
### MacroInference: Mean
data(ulcer)
ulcer.start <- gMLE.nn(ulcer$y, ulcer$se)$estimate
ulcer.ds <- DS.prior(ulcer, max.m = 4, ulcer.start)
ulcer.ds.macro <- DS.macro.inf(ulcer.ds, num.modes = 1, method = "mean", iters = 5)
ulcer.ds.macro
plot(ulcer.ds.macro)
## End(Not run)