Learn R Programming

BayesianFROC (version 0.3.1)

fit_GUI_Shiny: Fit a model with GUI of Shiny

Description

A graphical user interface (GUI) to fit a model to data.

Usage

fit_GUI_Shiny(
  DF = data.frame(h = c(97L, 32L, 31L), f = c(1L, 14L, 74L)),
  NL.min = 1,
  NL.max = 1111,
  NI.max = 1111,
  width_of_data_input_panel = 555,
  MCMC_initial_sample_size = 333,
  min_MCMC_initial_sample_size = 111,
  max_MCMC_initial_sample_size = 11111,
  seed.MCMC.max = 111111,
  MCMC_initial_seed = 1,
  MCMC_initial_chains = 1,
  NL.initial = 259,
  NI.initial = 57,
  DF_NL = data.frame(NL.initial = 259),
  DF_NI = data.frame(NI.initial = 57),
  MCMC.chains.max = parallel::detectCores()
)

Arguments

DF

A dataframe as an initial data to be fitted a model

NL.min

min number of bins indicating the minimal number in which the number of lesions can move

NL.max

max number of bins indicating the maximal number in which the number of lesions can move

NI.max

max number of bins indicating the maximal number in which the number of imagegs can move

width_of_data_input_panel

width of data panel

MCMC_initial_sample_size

Natural number indicating the initial number of MCMC samplings, Default value =333

min_MCMC_initial_sample_size

Natural number indicating the initial minimum number of MCMC samplings, Default value =333

max_MCMC_initial_sample_size

Natural number indicating the initial maximal number of MCMC samplings, Default value =333

seed.MCMC.max

Natural number indicating the initial possible maximal seed of MCMC samplings, Default value =111111

MCMC_initial_seed

Natural number indicating the initial number of MCMC samplings, Default value =333

MCMC_initial_chains

Natural number indicating the initial number of MCMC samplings, Default value =333

NL.initial

Natural number indicating the initial number of lesions, Default value =259.

NI.initial

Natural number indicating the initial number of images, Default value =57

DF_NL

A data-frame, consisting of a positive number representing the number of lesions

DF_NI

A data-frame, consisting of a positive number representing the number of images

MCMC.chains.max

max number of bins indicating number of MCMC chains

Value

None

Details

First, please execute, then user will understand what it is. This function is the one of the most important function in this package. I do not assume that the user is familiar with R script but FROC analysis. So, I made this function to provide the Graphical User Interface (GUI) for users to avoid CUI (Characteristic User Interface). The GUI is made by the shiny package.

Examples

Run this code
# NOT RUN {
## Only run examples in interactive R sessions
if (interactive()) {
#========================================================================================
#            1)           Use the default User Interface
#========================================================================================
#'

#No need to consider the variables, it is sufficient in  default values.


 fit_GUI_Shiny()




#========================================================================================
#            2)           Change the  User Interface
#========================================================================================


#  We can change the max imput of the number of lesions and the max of number of images
#

 fit_GUI_Shiny(NL.max = 2222,
                NI.max = 3333)





#========================================================================================
#            3)           Change the  Default value
#========================================================================================



 fit_GUI_Shiny(
 DF= data.frame( h=dataList.Chakra.4$h,
                 f=dataList.Chakra.4$f
               )
              )

# Or equivalently,

  fit_GUI_Shiny(
            DF= data.frame(
            h = c(160,  25,  15,   7),
            f = c(  8,  16,  18,  13)
                         )
            )


#========================================================================================
#            4)           Change the user Imterface
#========================================================================================



     fit_GUI_Shiny(

          DF= data.frame(
              h = c(160,  25,  15,   7),
              f = c(  8,  16,  18,  13)
                ),

                NL.max = 1192,
                NI.max = 794,
                MCMC.chains.max = 6

              )





#========================================================================================
#            5) CUI rather than GUI input
#========================================================================================


#              How to input data using CUI?
#                           This example gives an answer.
#

# CUI:  Characteristic user interface


# Here, I show the very strange data, that is, the number of hits is all 33
# and replicated 10 times, that is,
# h is substituted by rep(33L,10) indicating  33 33 33 33 33 33 33 33 33 33
# f is also same as h.




  fit_GUI_Shiny(NL.initial=555,
               DF =data.frame(
                 h= as.integer(rep(33,10)),
                 f= as.integer(rep(33,10))
               )
 )


# The author made this example since, when I check my program,
# such as whether the color used in polygon() is appropriate or not.

# If user thinks that it is very hard to input hits and false alarms
# by GUI manner, then use this characteristic like manner.

















#========================================================================================
#            6) Change maximul possible number of chains
#========================================================================================


# We can generate at most 8 chains in MCMC sampling


    fit_GUI_Shiny(  MCMC.chains.max = 8 )






}### Only run examples in interactive R sessions

# }

Run the code above in your browser using DataLab