Learn R Programming

BayesianFROC (version 0.2.1)

draw_latent_signal_distribution: Visualization of Latent Gaussians ( Signal Distribution)

Description

Visualization of Latent Gaussians ( Signal Distribution)

Usage

draw_latent_signal_distribution(StanS4class, dark_theme = TRUE,
  dig = 3, mesh = 1000, new.imaging.device = TRUE, hit.rate = TRUE,
  false.alarm.rate = FALSE, both.hit.and.false.rate = FALSE,
  density = 22, color = TRUE, mathmatical.symbols = TRUE, type = 3)

Arguments

StanS4class

An S4 object of class stanfitExtended which is an inherited class from the S4 class stanfit. This R object can be passed to the DrawCurves(), ppp() and ... etc

dark_theme

TRUE or FALSE

dig

An positive integer, indicating the digit for numbers in the R console.

mesh

Mesh for painting the area

new.imaging.device

Logical: TRUE of FALSE. If TRUE (default), then open a new device to draw curve. Using this we can draw curves in same plain by new.imaging.device=FALSE.

hit.rate

whether draws it. Default is TRUE.

false.alarm.rate

whether draws it. Default is TRUE.

both.hit.and.false.rate

whether draws it. Default is TRUE.

density

A natural number, indicating the density of shading lines, in lines per inch.

color

A color region is selected from black and white only. For more colors, put FALSE. For publication, the mono color is allowed in many case, so the author made this for such publication.

mathmatical.symbols

A logical, whether legend is in plot. @seealso draw_latent_noise_distribution() Note that the difference of draw_latent_noise_distribution() and draw_latent_signal_distribution() is that the lator use the standard Gaussian for the reference distribution and former uses the \(d \log \Phi()\) for the reference distribution.

So, the old version draw_latent_signal_distribution() is also important and I like this old version also. Anyway who read this, I think my package size is very large,....ha,,,,I have to reduce it,....but how?

type

An integer, for the color of background and etc.

Value

Information of Latent Gaussians, such as mean and S.D. of the signal distributions and thresholds.

Details

Our FROC model use a latent Gaussian random variable to determine hit rates. That is each hit rate is defined as follows;

$$ p_5(z_1,...z_C; \mu, \sigma) = \int_{z5}^{\infty} Gaussian(z|\mu,\sigma)dz$$ $$ p_4(z_1,...z_C; \mu, \sigma) = \int_{z4}^{z5} Gaussian(z|\mu,\sigma)dz$$ $$ p_3(z_1,...z_C; \mu, \sigma) = \int_{z3}^{z4} Gaussian(z|\mu,\sigma)dz$$ $$ p_2(z_1,...z_C; \mu, \sigma) = \int_{z2}^{z3} Gaussian(z|\mu,\sigma)dz$$ $$ p_1(z_1,...z_C; \mu, \sigma) = \int_{z1}^{z2} Gaussian(z|\mu,\sigma)dz$$

For example, in the following data, the number of hit data with confidence level 5 41 which is considered as an sample from the Binomial distribution of hit rate \(p_5(z_1,...z_C; \mu, \sigma) = \int_{z5}^{\infty} Gaussian(z|\mu,\sigma)dz\) with Bernoulli trial number is NL=142.

So, this Gaussian distribution determines hit rate, and this function draw_latent_signal_distribution() plot this Gaussian distribution \( Gaussian(z|\mu,\sigma)\). And reference distribution is the standard Gaussian and do not confuse that it is not the noise distribution, but only reference.

The noise distribution is \(d \log \Phi\) which determines the False alarm rate in the above manner. The author thinks the standard Gaussian is more comfortable to compare or confirm the shape of \( Gaussian(z|\mu,\sigma)\) and thus, the author implement it in the draw_latent_signal_distribution().

One would want to see the signal distribution and noise distribution simultaneously, then use the function draw_latent_noise_distribution().

Example data:

A single reader and a single modality case

------------------------------------------------------------------------------------------------------

NI=63,NL=124 confidence level No. of false alarms No. of hits
In R console -> c f h
----------------------- ----------------------- ----------------------------- -------------
definitely present 5 1 41
probably present 4 2 22
equivocal 3 5 14
subtle 2 11 8
very subtle 1 13 1

---------------------------------------------------------------------------------------------------

* false alarms = False Positives = FP

* hits = True Positives = TP

Examples

Run this code
# NOT RUN {
#----------------------------------------------------------------------------------------
#   Shap of signal distribution strongly influences teh value of AUC, so in the following
#   the author shows how it affects the estimates of AUCs.
#    We consider two data examples, one is a low AUC and the other is a high AUC.
#   In the high AUC case, the Signal Gaussain will be low variance and
#   in the low AUC case, the variance will desperse.  2019 August 4, 2019 Dec 17
#----------------------------------------------------------------------------------------


#            ----- High AUC case --------

     viewdata(dataList.High)

     fit.High <- fit_Bayesian_FROC(dataList.High,ite=111)

     draw_latent_signal_distribution(fit.High)




#            ----- Low AUC case --------

     viewdata(dataList.Low)

     fit.Low <- fit_Bayesian_FROC(dataList.Low)

     draw_latent_signal_distribution(fit.Low)




#--------------------------------------------------------------------------------------
#                         2)      For submission (without color)
#--------------------------------------------------------------------------------------





     fit <-    fit_Bayesian_FROC(
                                 dataList = dataList.Chakra.1.with.explantation
                                 )





     draw_latent_signal_distribution(fit,
                   dark_theme = F,
                   color = T,
                   density = 11
                   )



             # 2019 Sept. 5






# }
# NOT RUN {
# dottest
# }

Run the code above in your browser using DataLab