draw_latent_signal_distribution: Visualization of Latent Gaussians ( Signal Distribution)

Description Usage Arguments Details Value See Also Examples

View source: R/draw_latent_distribution.R

Description

Plot the posterior mean of model parameter θ and the parameter of the latent function, i.e. the normal distribution denoted by Gaussian(z|μ,σ) with posterior mean estimates of its mean μ and standard deviation σ.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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,
  summary = FALSE
)

Arguments

StanS4class

An S4 object of class stanfitExtended which is an inherited class from the S4 class stanfit. This R object is a fitted model object as a return value of the function fit_Bayesian_FROC().

To be passed to DrawCurves() ... etc

dark_theme

TRUE or FALSE

dig

A 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.

type

An integer, for the color of background and etc.

summary

Logical: TRUE of FALSE. Whether to print the verbose summary. If TRUE then verbose summary is printed in the R console. If FALSE, the output is minimal. I regret, this variable name should be verbose.

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; μ, σ) = \int_{z5}^{∞} Gaussian(z|μ,σ)dz

p_4(z_1,...z_C; μ, σ) = \int_{z4}^{z5} Gaussian(z|μ,σ)dz

p_3(z_1,...z_C; μ, σ) = \int_{z3}^{z4} Gaussian(z|μ,σ)dz

p_2(z_1,...z_C; μ, σ) = \int_{z2}^{z3} Gaussian(z|μ,σ)dz

p_1(z_1,...z_C; μ, σ) = \int_{z1}^{z2} Gaussian(z|μ,σ)dz

For example, in the following data, the number of hit data with the most highest confidence level 5 is regarded as an sample from the Binomial distribution of hit rate p_5(z_1,...z_C; μ, σ) = \int_{z5}^{∞} Gaussian(z|μ,σ)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|μ,σ). And a reference distribution is the standard Gaussian and do not confuse that it is not the noise distribution, but only reference.

The noise distribution (denoted by d \log Φ) determines the False alarm rates in the similar manner and plotted by using a line of dots. The author thinks the standard Gaussian is more comfortable to compare or confirm the shape of Gaussian(z|μ,σ) 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().

Value

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

See Also

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 Φ() 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?

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
## Not run: 
#========================================================================================
#   Shape of signal distribution strongly influences the 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
                                 )




# With legends


     draw_latent_signal_distribution(fit,
                   dark_theme  = FALSE,
                   color = TRUE,
                   density = 11
                   )



#' Without legends
draw_latent_signal_distribution(fit,
                                dark_theme           = FALSE,
                                color               = TRUE,
                                mathmatical.symbols = FALSE
)
             # 2019 Sept. 5
             # 2020 March 12



     Close_all_graphic_devices() # 2020 August


## End(Not run)# dottest

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