DS.prior {BayesGOF}R Documentation

Prior Diagnostics and Estimation

Description

A function that generates the uncertainty diagnostic function (U-function) and estimates DS(G,m)(G,m) prior model.

Usage

DS.prior(input, max.m = 8, g.par, 
         family = c("Normal","Binomial", "Poisson"), 
         LP.type = c("L2", "MaxEnt"), 
         smooth.crit = "BIC", iters = 200, B = 1000,
		 max.theta = NULL)

Arguments

input

For "Binomial", a dataframe that contains the kk pairs of successes yy and the corresponding total number of trials nn. For "Normal", a dataframe that has the kk means yiy_i in the first column and their respective standard errors sis_i in the second. For the "Poisson", a vector of that includes the untabled count data.

max.m

The truncation point mm reflects the concentration of true unknown π\pi around known gg.

g.par

Vector with estimated parameters for specified conjugate prior distribution gg (i.e beta prior: α\alpha and β\beta; normal prior: μ\mu and τ2\tau^2; gamma prior: α\alpha and β\beta).

family

The distribution of yiy_i. Currently accommodates three families: Normal, Binomial, and Poisson.

LP.type

User selects either "L2" for LP-orthogonal series representation of U-function or "MaxEnt" for the maximum entropy representation. Default is L2.

smooth.crit

User selects either "BIC" or "AIC" as criteria to both determine optimal mm and smooth final LP parameters; default is "BIC".

iters

Integer value that gives the maximum number of iterations allowed for convergence; default is 200.

B

Integer value for number of grid points used for distribution output; default is 1000.

max.theta

For "Poisson", user can provide a maximum theta value for prior; default is the maximum count value in input.

Details

Function can take m=0m=0 and will return the Bayes estimate with given starting parameters. Returns an object of class DS.GF.obj; this object can be used with plot command to plot the U-function (Ufunc), Deviance Plots (mDev), and DS-G comparison (DS_G).

Value

LP.par

mm smoothed LP-Fourier coefficients, where mm is determined by maximum deviance.

g.par

Parameters for gg.

LP.max.uns

Vector of all LP-Fourier coefficients prior to smoothing, where the length is the same as max.m.

LP.max.smt

Vector of all smoothed LP-Fourier coefficients, where the length is the same as max.m.

prior.fit

Fitted values for the estimated prior.

UF.data

Dataframe that contains values required for plotting the U-function.

dev.df

Dataframe that contains deviance values for values of mm up to max.m.

m.val

The value of mm (less than or equal to the maximum mm from user) that has the maximum deviance and represents the appropriate number of LP-Fourier coefficients.

sm.crit

Smoothing criteria; either "BIC" or "AIC".

fam

The user-selected family.

LP.type

User-selected representation of U-function.

obs.data

Observed data provided by user for input.

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

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
plot(rat.ds, plot.type = "Ufunc")
plot(rat.ds, plot.type = "DSg")
plot(rat.ds, plot.type = "mDev")

[Package BayesGOF version 5.2 Index]