array_of_hit_and_false_alarms_from_vector: Array of hits and false alarms; 2019 Jun 18

Description Usage Arguments Details Value See Also Examples

View source: R/array_of_hit_and_false_alarms_from_vector.R

Description

Return value is a three dimensional array of type [C,M,Q] representing the number of confidence levels and modalities and readers, respectively. This array includes the number of hit and the number of false alarms.

Revised 2019 Nov. 20

Usage

1

Arguments

dataList

A list, consisting of the following R objects:m,q,c,h,f,NL,C,M,Q each of which means from the right

m : A vector, indicating the modality ID = 1,2,... which does not include zero.

q : A vector, indicating the reader ID = 1,2,... which does not include zero.

c : A vector, indicating the confidence = 1,2,... which does not include zero.

h : A vector, indicating the number of hits

f : A vector, indicating the number of false alarm

NL : A positive integer, indicating the number of lesions for all images

C : A positive integer, indicating the highest number of confidence level

M : A positive integer, indicating the number of modalities

Q : A positive integer, indicating the number of readers.

The detail of these dataset, please see the example datasets, e.g. dd.

Details

The author also implemented this in the metadata_to_fit_MRMC which is an old version. However, the old version uses "for" sentences, and it is not so better. On the other hand, this function use the function aperm() and array() and they are better than "for" sentence.

Revised 2019 Nov. 20 Revised 2019 Dec. 12

Value

A list, whose components are arrays of the number of hits h and the number of false alarms f of dimension [c,M,Q]. Do not confuse [c,Q,M] or [M,Q,C], etc. Revised 2019 Nov. 20

See Also

Chi_square_goodness_of_fit_in_case_of_MRMC_Posterior_Mean

Examples

 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#--------------------------------------------------------------------------------------
#                        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






## End(Not run)

BayesianFROC documentation built on Jan. 23, 2022, 9:06 a.m.