-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
135 lines (112 loc) · 5.19 KB
/
ui.R
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
library(shiny)
library(shinydashboard)
library(plotly)
setwd("~/Documents/compstat2016/")
dashboardPage(
# Dashboard header
dashboardHeader(title = "Tareas de estadistica Computacional",titleWidth = 250),
dashboardSidebar(
sidebarMenu(
menuItem("Tarea 01", tabName = "tarea_1", icon = icon("unlock")),
menuItem("Tarea 02", tabName = "tarea_2", icon = icon("unlock")),
menuItem("Tarea 04, 05 y 06", tabName = "tarea_4_5_6", icon = icon("unlock"))
)
),
#Body
dashboardBody(
tabItems(
tabItem("tarea_1",
# First Row
fluidRow(
sidebarPanel(
sliderInput("lambda",
"Parámetro lambda",
min = 0,
max = 1,
value = .5),
sliderInput("iterations",
"Número de muestras",
min= 1,
max= 1000,
value= 800),
sliderInput("nbins",
"Números de particiones",
min= 1,
max= 100,
value= 50),
downloadButton('downloadData', 'Descarga muestra')
),
column(6, verbatimTextOutput("chi"))
),
# Second Row
fluidRow(
column(6, plotlyOutput("trendPlot",height = 500)),
column(6, dataTableOutput("tabla"))
)
), # end vis item
# Second menu tab
tabItem("tarea_2",
fluidRow(
sidebarPanel(
numericInput("inf","Limite inferior",value=0),
numericInput("sup","Limite Superior",value = 10),
numericInput("n_sim","Numero de simulaciones",value = 10),
textInput("fun","funcion",value = "function (x) x*3", placeholder = "Funcion a integrar"),
numericInput("confianza", "Intervalo de confianza ", min = 0, max = 1,value = 0.20)
),
column(6, plotOutput("montecarlo_plot_dis",height = 400))
),
fluidRow(
column(6, plotOutput("montecarlo_plot",height = 400)),
column(6, dataTableOutput("tabla_mc"))
)
),
tabItem("tarea_4_5_6",
fluidRow(
sidebarPanel(
titlePanel("Parametros a priori"),
selectInput("dep", "Variable dependiente", c("X" = "dis", "Y" = "pro")),
sliderInput("a", " Parametro a priori a ~ Unif ", min=1, max=10, value=c(1,10)),
sliderInput("b", "Parametro a priori b ~ Unif", min=1, max=10, value=c(1,10)),
sliderInput("sigma", "Parametro a priori sigma ~ Unif", min=1, max=10, value=c(1,10))
),
sidebarPanel(
titlePanel("Parametros MCMC"),
numericInput("n_cadena", "cadenas a simular", value=1, min=1, max=10, step=1),
sliderInput("l_cadena", "longitud de cadenas", min=10000, max=100000, value=10000),
actionButton("run_mcmc_b", "Calcula MCMC")
)
),
fluidRow(
tabsetPanel(type="tabs",
tabPanel("Datos",
fluidRow(
column(6, plotlyOutput("scatter_variables",height = 500)),
column(6, dataTableOutput("tabla_regresion"))
)
),
tabPanel("Cadenas",
fluidRow(
dataTableOutput("cadenasMCMC")
)
),
tabPanel("Histograma a priori",
fluidRow(
column(4, plotlyOutput("histo_a",height = 500)),
column(4, plotlyOutput("histo_b",height = 500)),
column(4, plotlyOutput("histo_sigma",height = 500))
)
),
tabPanel("Histograma posteriori",
fluidRow(
column(4, plotlyOutput("posterior_a",height = 500)),
column(4, plotlyOutput("posterior_b",height = 500)),
column(4, plotlyOutput("posterior_sigma",height = 500))
)
)
)
)
)
) # end tab items
) # end dash body
)