DS.prior {BayesGOF}  R Documentation 
A function that generates the uncertainty diagnostic function (Ufunction
) and estimates DS(G,m)
prior model.
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)
input 
For 
max.m 
The truncation point 
g.par 
Vector with estimated parameters for specified conjugate prior distribution 
family 
The distribution of 
LP.type 
User selects either 
smooth.crit 
User selects either 
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 
Function can take m=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 Ufunction (Ufunc
), Deviance Plots (mDev
), and DSG comparison (DS_G
).
LP.par 

g.par 
Parameters for 
LP.max.uns 
Vector of all LPFourier coefficients prior to smoothing, where the length is the same as 
LP.max.smt 
Vector of all smoothed LPFourier coefficients, where the length is the same as 
prior.fit 
Fitted values for the estimated prior. 
UF.data 
Dataframe that contains values required for plotting the Ufunction. 
dev.df 
Dataframe that contains deviance values for values of 
m.val 
The value of 
sm.crit 
Smoothing criteria; either 
fam 
The userselected family. 
LP.type 
Userselected representation of 
obs.data 
Observed data provided by user for 
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/s41598018281305.
Mukhopadhyay, S., 2017. "LargeScale Mode Identification and DataDriven Sciences," Electronic Journal of Statistics, 11(1), pp.215240.
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")