# NOT RUN {
#--------------------------------------------------------------------------------------
# Validation of program
#--------------------------------------------------------------------------------------
h1 <- array_of_hit_and_false_alarms_from_vector(dd)$harray
h2 <- metadata_to_fit_MRMC(dd)$harray
h1 == h2
f1 <- array_of_hit_and_false_alarms_from_vector(dd)$farray
f2 <- metadata_to_fit_MRMC(dd)$farray
f1 == f2
#--------------------------------------------------------------------------------------
# subtraction for ( hit - hit.expected)
#--------------------------------------------------------------------------------------
# In the chi square calculation,
# we need to subtract expected value of hit from hit rate,
# thus the author made this function.
# }
# NOT RUN {
# Prepare example data
dd <- BayesianFROC::dd
# Fit a model to data
fit <- fit_Bayesian_FROC( dataList = dd,
ite = 1111 )
# Extract a collection of expected hits as an array
harray.expected <- extract_EAP_by_array(fit,ppp)*dd$NL
# Prepare hit (TP) data as an array
harray <- array_of_hit_and_false_alarms_from_vector(dd)$harray
# Calculate the difference of hits and its expectation..
Difference <- harray - harray.expected
# The above calculation is required in the chi square goodness of fit
#======================================================================================
# array format hit and false
#======================================================================================
harray <- array_of_hit_and_false_alarms_from_vector(dataList = ddd)$harray
farray <- array_of_hit_and_false_alarms_from_vector(dataList = ddd)$farray
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab