Description Usage Arguments Details Value Examples
View source: R/p_value_of_the_Bayesian_sense_for_chi_square_goodness_of_fit.R
Synthesizes samples from posterior predictive distributions.
1 2 3 4 5 6 7 8 9 | get_samples_from_Posterior_Predictive_distribution(
StanS4class,
counter.plot.via.schatter.plot = TRUE,
new.imaging.device = TRUE,
upper_x,
upper_y,
Colour = TRUE,
plot.replicated.points = TRUE
)
|
StanS4class |
An S4 object of class To be passed to |
counter.plot.via.schatter.plot |
Logical: |
new.imaging.device |
Logical: |
upper_x |
A non-negative real number. This is a upper bound for the axis of the horisontal coordinate of FROC curve. |
upper_y |
A non-negative real number. This is a upper bound for the axis of the vertical coordinate of FROC curve. |
Colour |
Logical: |
plot.replicated.points |
TRUE or FALSE. If true, then plot replicated points (hits, false alarms) by the scatter plot. This process will takes a long times. So if user has no time, then |
This methods to draw from the PPD is described in Gelman book, Bayesian Data Analysis. The aim of this function is to evaluate the chi square test statistics as a Bayesian sense. According to Gelman book, the chi square test need the samples from the PPD. So, we use this function to accomplish this task.
A list of datalists from the posterior predictive distribution
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | ## Not run:
fit <- fit_Bayesian_FROC(
ite = 1111,
summary = FALSE ,
dataList = BayesianFROC::dataList.Chakra.1 )
#======= The first example ======================================================
TPs.FPs <- get_samples_from_Posterior_Predictive_distribution(fit)
#======= The Second Example: Short cut ===========================================
# If user has no time, then plot.replicated.points=FALSE will help you.
# By setting FALSE, the replicated data from the posterior predictive
# distribution does not draw, and hence the running time of function become shorter.
TPs.FPs <- get_samples_from_Posterior_Predictive_distribution(fit,
plot.replicated.points = FALSE)
# Close the graphic device to avoid errors in R CMD check.
grDevices::dev.new();plot(stats::runif(100),stats::runif(100))
#================The third example: From Hand made data to fitting ==========
# To draw the scatter plots of hits and false alarms synthesized from the posterior
# predictive distribution for the submission to a journal,
# then the colored plot is not appropriate.
# So, by setting the argument Colour = FALSE, the scatter plot colored by black and white.
# we use the resulting plot for submission.
get_samples_from_Posterior_Predictive_distribution(fit,Colour = FALSE)
g <-get_samples_from_Posterior_Predictive_distribution(fit)
x <- g$CFP
y <- g$CTP
plot( hexbin::hexbin(unlist(x),unlist(y)) )
# Close the graphic device to avoid errors in R CMD check.
Close_all_graphic_devices()
## End(Not run)# dottest
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.