Description Usage Arguments Details Value Examples
View source: R/fit_GUI_Shiny.R
A graphical user interface (GUI) to fit a model to data.
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 | fit_GUI_Shiny(
DF = data.frame(f = c(1L, 14L, 74L), h = c(97L, 32L, 31L)),
NL.initial = 259L,
NI.initial = 57L,
samples_from_likelihood_for_ppp.initial = 5L,
samples_from_likelihood_for_ppp.max = 111L,
NL.min = 1L,
NL.max = 1111L,
NI.max = 1111L,
width_of_data_input_panel = 555L,
MCMC_iterations_love.initial = 1111L,
min_MCMC_iterations_love.initial = 22L,
max_MCMC_iterations_love.initial = 11111L,
seed.MCMC.max = 111111L,
Seed_of_MCMC_love.initial = 1234L,
parallel_MCMC_chains_love.initial = 1L,
ww.initial = -11,
www.initial = 11,
mm.initial = 0.65,
mmm.initial = 11,
vv.initial = 5.31,
vvv.initial = 11,
zz.initial = 1.55,
zzz.initial = 11,
DF_NL = data.frame(NL.initial = NL.initial),
DF_NI = data.frame(NI.initial = NI.initial),
DF_samples_from_likelihood = data.frame(samples_from_likelihood_for_ppp.initial =
samples_from_likelihood_for_ppp.initial),
print_debug = FALSE,
MCMC.chains.max = parallel::detectCores()
)
|
DF |
A dataframe as an initial data to be fitted a model |
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 |
samples_from_likelihood_for_ppp.initial |
initial value of number of samples |
samples_from_likelihood_for_ppp.max |
maximal value of samples |
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_iterations_love.initial |
Natural number indicating the initial number of MCMC samplings, Default value = 1111L |
min_MCMC_iterations_love.initial |
Natural number indicating the initial minimum number of MCMC samplings, Default value =333 |
max_MCMC_iterations_love.initial |
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 |
Seed_of_MCMC_love.initial |
Natural number indicating the initial number of MCMC samplings, Default value =1234L |
parallel_MCMC_chains_love.initial |
Natural number indicating the initial number of MCMC samplings, Default value =333 |
ww.initial, www.initial, mm.initial, mmm.initial, vv.initial, vvv.initial, zz.initial, zzz.initial |
parameters for prior |
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 |
DF_samples_from_likelihood |
auxilary data frame for samples |
print_debug |
A logical, whether debug messages are printed or not. In Shiny, initial values can be specified. However, it dose not work correctly for me. Thus, I examine what values are passed .... so this variable used for the treatments of initial values, mainly. |
MCMC.chains.max |
max number of bins indicating number of MCMC chains |
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.
In global environment, R object named "f" and "d" are
In global environment, an R object named "f" is created, in which fitted model object is included. This is not return value, you know, cuz
.Last.value
is not the object "f". However, you know, for the pretty cute, it is sufficient.
In global environment, an R object named "d" is created, which is the dataset to which the model is fitted.
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 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | ## 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(
f = c( 8, 16, 18, 13),
h = c(160, 25, 15, 7)
)
)
# Note that the following is wrong
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(
f = c( 8, 16, 18, 13),
h = c(160, 25, 15, 7)
),
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(
f= as.integer(rep(33,10)),
h= 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 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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.