File size: 6,863 Bytes
5227b9c
 
d2f9349
5227b9c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
library(shiny)
library(ggplot2)

# Define UI for application that draws a histogram
shinyUI(fluidPage(

    # Application title
    titlePanel("glm distributions"),
    
    h4("Select the glm distribution and then fixe
       the parameters to obtain the probability distribution."),

    # Sidebar with a slider input for number of bins
    sidebarLayout(
        sidebarPanel(
          
          selectInput("Distribucion",
                      "What distribution?",
                      choices=c("Normal", "Gamma", "Inv. gaussian", 
                                "Binomial",
                                "Poisson", "Negative binomial"),
                      selected="Normal"),
          
          conditionalPanel(condition="input.Distribucion=='Normal'",
                           numericInput(inputId="mu_normal",
                                        label=HTML("Select μ:"),
                                        value="0.5",
                                        step=0.01),
                           
                           numericInput(inputId="sigma",
                                        label=HTML("Select σ:"),
                                        min=0.01,
                                        value="1.2",
                                        step=0.01),
                           
                           numericInput(inputId="min_normal",
                                        label="Select the minimun value for xlim",
                                        value="-1", step=1),
                           numericInput(inputId="max_normal",
                                        label="Select the maximum value for xlim",
                                        value="3", step=1)
                           
                           ),
          
          conditionalPanel(condition="input.Distribucion=='Gamma'",
                           numericInput(inputId="mu_gamma",
                                        label=HTML("Select μ:"),
                                        min=0.01,
                                        value=1.5,
                                        step=0.01),
                           
                           numericInput(inputId="phi_gamma",
                                        label=HTML("Select φ:"),
                                        min=0.01,
                                        value=0.3,
                                        step=0.01),
                           
                           numericInput(inputId="min_gamma",
                                        label="Select the minimun value for xlim",
                                        value="0.01", step=1),
                           numericInput(inputId="max_gamma",
                                        label="Select the maximum value for xlim",
                                        value="3", step=1)
                           
                           ),
          
          conditionalPanel(condition="input.Distribucion=='Inv. gaussian'",
                           numericInput(inputId="mu_invgaus",
                                        label=HTML("Select μ:"),
                                        min=0.01,
                                        value="1.5",
                                        step=0.01),
                           
                           numericInput(inputId="phi_invgaus",
                                        #label=HTML("Select φ:"),
                                        label="Select φ",
                                        min=0.1,
                                        value="1.2",
                                        step=0.1),
                           
                           numericInput(inputId="min_invgaus",
                                        label="Select the minimun value for xlim",
                                        value="0.01", step=1),
                           numericInput(inputId="max_invgaus",
                                        label="Select the maximum value for xlim",
                                        value="3", step=1)
                           
                           ),
          
          conditionalPanel(condition="input.Distribucion=='Binomial'",
                           numericInput(inputId="mu_binom",
                                        label=HTML("Select μ:"),
                                        min=0.01,
                                        max=0.99,
                                        value=0.3,
                                        step=0.01),
                           
                           numericInput(inputId="m",
                                        label=HTML("Select m the number of experiments"),
                                        min=1,
                                        value=7,
                                        step=1)
                           ),
          
          conditionalPanel(condition="input.Distribucion=='Poisson'",
                           numericInput(inputId="mu_pois",
                                        label=HTML("Select μ:"),
                                        min=0.01,
                                        value="2.7",
                                        step=0.01),
                           
                           numericInput(inputId="max_pois",
                                        label="Select the maximum value for xlim",
                                        value="15", step=1)
                           
                           ),
          
          conditionalPanel(condition="input.Distribucion=='Negative binomial'",
                           numericInput(inputId="mu_negbin",
                                        label=HTML("Select μ:"),
                                        min=0.01,
                                        value="2.7",
                                        step=0.01),
                           
                           numericInput(inputId="k",
                                        label=HTML("Select k"),
                                        min=0.01,
                                        value="1.6",
                                        step=0.01),
                           
                           numericInput(inputId="max_negbin",
                                        label="Select the maximum value for xlim",
                                        value="15", step=1)
                           
                           
                           ),
          
          img(src="logo.png", height = 60, width = 140),
          
        ),

        # Show a plot of the generated distribution
        mainPanel(
            plotOutput("distPlot", width = "400px")
        )
    )
))