# NOT RUN {
# }
# NOT RUN {
#========================================================================================
# 1) Build the data
#========================================================================================
# For singler reader and single modality case.
dat <- list(c=c(3,2,1), #Confidence level. Note that c is ignored.
h=c(97,32,31), #Number of hits for each confidence level
f=c(1,14,74), #Number of false alarms for each confidence level
NL=259, #Number of lesions
NI=57, #Number of images
C=3) #Number of confidence level
# where,
# c denotes confidence level, i.e., rating of reader.
# 3 = Definitely deseased,
# 2 = subtle,.. deseased
# 1 = very subtle
# h denotes number of hits (True Positives: TP) for each confidence level,
# f denotes number of false alarms (False Positives: FP) for each confidence level,
# NL denotes number of lesions,
# NI denotes number of images,
# For example, in the above example data,
# the number of hits with confidence level 3 is 97,
# the number of hits with confidence level 2 is 32,
# the number of hits with confidence level 1 is 31,
# the number of false alarms with confidence level 3 is 1,
# the number of false alarms with confidence level 2 is 14,
# the number of false alarms with confidence level 1 is 74,
#--------------------------------------------------------------------------------------
# 2) Fit a model to the above data-set
#--------------------------------------------------------------------------------------
#Because dataset named dat is a single reader and a single modality,
#the function fit such a model by running the following code.
fit <- BayesianFROC::fit_Bayesian_FROC(
dat, # dataset
ite=1111, #To run in time <5s.
cha=1 # number of chains, it is better more large.
)
#--------------------------------------------------------------------------------------
# 3) Draw the FROC curve and signal and noise (logarithmic Gaussian)
#--------------------------------------------------------------------------------------
# Using the fitted model object of class stanfitExtended, we can draw curves.
plot_curve_and_hit_rate_and_false_rate_simultaneously(fit)
Close_all_graphic_devices() # 2020 August
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab