Description Usage Arguments Details Value See Also Examples
View source: R/fit_Bayesian_FROC.R
Fit a model to data.
1 2 3 4 5 6 7 | fit_a_model_to(
dataList,
number_of_parallel_chains_for_MCMC = 1,
number_of_iterations_for_MCMC = 1111,
seed_for_MCMC = 1234,
...
)
|
dataList |
A list, specifying an FROC data to be fitted a model. It consists of data of numbers of TPs, FPs, lesions, images. .In addition, if in case of mutiple readers or mutiple modalities, then modaity ID and reader ID are included also. The For the single reader and a single modality data, the
Using this object To make this R object
Before fitting a model,
we can confirm our dataset is correctly formulated
by using the function —————————————————————————————- A Single reader and a single modality (SRSC) case. —————————————————————————————- In a single reader and a single modality case (srsc),
The detail of these dataset, see the datasets endowed with this package.
'Note that the maximal number of confidence level, denoted by data Format: A single reader and a single modality case ——————————————————————————————————
————————————————————————————————— * false alarms = False Positives = FP * hits = True Positives = TP Note that in FROC data, all confidence level means present (diseased, lesion) case only, no confidence level indicating absent. Since each reader marks his suspicious location only if he thinks lesions are present, and marked positions generates the hits or false alarms, thus each confidence level represents that lesion is present. In the absent case, reader does not mark any locations and hence, the absent confidence level does not relate this dataset. So, if reader think it is no lesion, then in such case confidence level is not needed. Note that the first column of confidence level vector ————————————————————————————— Multiple readers and multiple modalities case, i.e., MRMC case ————————————————————————————— In case of multiple readers and multiple modalities, i.e., MRMC case,
in order to apply the function
Note that the maximal number of confidence level (denoted by the function Example data. Multiple readers and multiple modalities ( i.e., MRMC) —————————————————————————————————
————————————————————————————————— * false alarms = False Positives = FP * hits = True Positives = TP | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
number_of_parallel_chains_for_MCMC |
A positive integer, indicating the number of chains for MCMC. To be passed to the function | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
number_of_iterations_for_MCMC |
A positive integer, indicating the number of interations for MCMC. To be passed to the function | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
seed_for_MCMC |
A positive integer, indicating the seed for MCMC. To be passed to the function | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
... |
Additional arguments |
The author made a function
FROC data to be fitted a model
The following table is a dataset to be fitted a model.
——————————————————————————————————
confidence level | No. of false alarms | No. of hits | |
(FP:False Positive) | (TP:True Positive) | ||
----------------------- | ----------------------- | ----------------------------- | ------------- |
definitely present | 5 | F_5 | H_5 |
probably present | 4 | F_4 | H_4 |
equivocal | 3 | F_3 | H_3 |
subtle | 2 | F_2 | H_2 |
very subtle | 1 | F_1 | H_1 |
—————————————————————————————————
Modeling 1. Traditional way
Define
p_c(θ):= \int ^{θ_{c+1}}_{θ_c} Gaussian(z|μ, σ) dz,
q_c(θ):= \int ^{θ_{c+1}}_{θ_c} \frac{d}{dz} \log Φ(z) dz.
Note that θ_0 := - ∞.
We extend the vector from (H_c)_{c=1,2,...,C} to (H_c)_{c=0,1,2,...,C}, where H_0:= N_L - (H_1+H_2+...+H_C).
Then, we assume
(H_c)_{c=0,1,2,...,C} \sim Multinomial((p_c)_{c=0,1,2,...,C} )
and
F_c \sim Poisson(q_c(θ)N_I ).
Recall that N_I denotes the number of images (radiographs, such as X-ray films) and N_L the number of lesions (signals, nodules,).
fit_Bayesian_FROC()
which has
very redundant variables.
So, fit_a_model_to()
is made by simplifying fit_Bayesian_FROC()
so that its variables is minimum.
To access full details,
see the help of fit_Bayesian_FROC()
.
This function aims to give a simple interface by ignoring unnecessarly parameters of fit_Bayesian_FROC()
.
An fitted model
object of the S4 class named stanfitExtended
which is an inherited class from stanfit.
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 86 87 88 89 90 91 92 | ## Not run:
#========================================================================================
# 1) Build a data-set
#========================================================================================
# For a single reader and a single modality case.
data <- 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
viewdata(data)
# where,
# c denotes confidence level, i.e., rating of reader.
# 3 = Definitely diseased,
# 2 = subtle,.. diseased
# 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 an FROC model to the above dataset.
#========================================================================================
fit <- BayesianFROC::fit_a_model_to(
# Dataset to be fiited
dataList = data,
# To run in time <5s, MCMC iterations too small to obtain reliable estimates
number_of_iterations_for_MCMC = 1111,
# The number of chains, it is better if larger.
number_of_parallel_chains_for_MCMC = 1
)
#========================================================================================
# fit a FROC model using multinomial distribution
#========================================================================================
# The Chakraborty's model is fitted to data named "d"
fit <- fit_Bayesian_FROC(
multinomial = TRUE, # <--- here, the model of multinomial is declared
ite = 1111,
cha = 1,
summary = TRUE,
dataList = d # Example data to be fitted a model
)
## End(Not run)#dontrun
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.