# NOT RUN {
# }
# NOT RUN {
#========================================================================================
# Synthesize the MCMC samples from a dataset.
#========================================================================================
fit <- fit_Bayesian_FROC(BayesianFROC::dataList.Chakra.1,
ite = 1111,
summary =FALSE,
cha = 2)
#========================================================================================
# The chi square discrepancies are calculated by the following code
#========================================================================================
Chi.Square.for.each.MCMC.samples <- chi_square_goodness_of_fit(fit)
#========================================================================================
# With Warning
#========================================================================================
chi_square_goodness_of_fit(fit)
#========================================================================================
# Without warning
#========================================================================================
chi_square_goodness_of_fit(fit,
h=fit@dataList$h,
f=fit@dataList$f)
#========================================================================================
# Get posterior mean of the chi square discrepancy.
#========================================================================================
m<- mean(Chi.Square.for.each.MCMC.samples)
#========================================================================================
# The author read at 2019 Sept. 1, it helps him. Thanks me!!
#
# Calculate the p-value for the posterior mean of the chi square discrepancy.
#========================================================================================
stats::pchisq(m,df=1)
#========================================================================================
# Difference between chi sq. at EAP and EAP of chi sq.
#========================================================================================
mean( fit@chisquare - chi_square_goodness_of_fit(fit))
# }
# NOT RUN {
# dottest
# }
Run the code above in your browser using DataLab