# NOT RUN {
#========================================================================================
#2019 Sept 6 1) Using the default hit values, hit data are created as follows;
#========================================================================================
hits <- hits_creator_from_rate()
#========================================================================================
#2019 Sept 6 2) If user want to use their own hit rates, then use the following codes:
#========================================================================================
h <- hits_creator_from_rate(
NL=252,
seed =123,
p.truth =
array(c(
c(0.03,0.13,0.2,0.3,0.4, #for M=1 Q=1
0.04,0.23,0.3,0.4,0.5) , #for M=2 Q=1 ,
c(0.05,0.33,0.4,0.5,0.6, #for M=1 Q=2
0.06,0.43,0.5,0.6,0.7) ,#for M=2 Q=2 ,
c(0.07,0.53,0.6,0.7,0.8, #for M=1 Q=3
0.08,0.63,0.7,0.8,0.9) #for M=2 Q=3 ,
),
dim = c(5,2,3) #C M Q
)#array
)
#========================================================================================
#2019 Sept 6 3) If user want to use their own hit rates, then use the following codes:
#========================================================================================
h <- hits_creator_from_rate(
NL=252,
seed =123,
p.truth =
array(c(
c(0.03,0.1,0.2,0.3,0.4, #for M=1 Q=1
0.04,0.2,0.3,0.4,0.5, #for M=2 Q=1
0.05,0.3,0.4,0.5,0.6), #for M=3 Q=1
c(0.05,0.33,0.4,0.5,0.6, #for M=1 Q=2
0.06,0.43,0.5,0.6,0.7, #for M=2 Q=2
0.05,0.3,0.4,0.5,0.6), #for M=3 Q=2
c(0.07,0.53,0.6,0.7,0.8, #for M=1 Q=3
0.08,0.63,0.7,0.8,0.9, #for M=2 Q=3
0.05,0.3,0.4,0.5,0.6) #for M=3 Q=3
),
dim = c(5,3,3) #C M Q
)#array
)
#========================================================================================
#2019 Sept 6 3) Only one reader
#========================================================================================
h <- hits_creator_from_rate(
NL=252,
seed =123,
p.truth =
array(c(
c(0.03,0.1,0.2,0.3,0.4, #for M=1 Q=1
0.04,0.2,0.3,0.4,0.5, #for M=2 Q=1
0.05,0.3,0.4,0.5,0.6) #for M=3 Q=1
),
dim = c(5,3,1) #C M Q
)#array
)
#========================================================================================
#
#========================================================================================
#================The third example======================================
# The hits rate cannot take any values, since there is a trend that a hit rate of
# a higher confidence level is a higher. So, If it is difficult for user to create
# a true hit rates, then by taking estimates as true parameters,
# user can replicate datasets.
# To do so, work follow is first fitting, secondly extracting estimates,
# thirdly apply this function (hits_creator_from_rate() ).
# * Fitting
fit <- fit_Bayesian_FROC(
dataList.Chakra.Web.orderd,
ite = 1111, # For simplicity, we take small MCMC samples.
summary =FALSE)
# * Extracting
estimates <- extract_estimates_MRMC(fit)
ppp <- estimates$ppp.EAP
# Note that ppp is an array
# whose dimension is constituted by number of confidence levels, modalities, readers.
# * Replicating as an true values is ppp
hits <- hits_creator_from_rate(p.truth = ppp )
# <<Remark>>
# ppp is an array. ignoring its indices, we can write that
# hits ~ Binomial(ppp, NL)
# Where NL is a number of lesions.
# By writing its component explicitly, we can write
# Hits[c,m,r] ~ Binomial(ppp[c,m,r], NL)
# Where c means the c-th confidence level,
# m means the m-th modality,
# r means the r-th reader.
# }
# NOT RUN {
# dottest
# }
Run the code above in your browser using DataLab