forked from pmaier1971/AutomatedForecastingWithShiny
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui.R
More file actions
157 lines (154 loc) · 12.8 KB
/
Copy pathui.R
File metadata and controls
157 lines (154 loc) · 12.8 KB
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
156
157
library(shiny)
library(shinyIncubator)
library(rmarkdown)
library(rDrop)
TwitterString <- "<a width='1000' class='twitter-timeline' href='https://twitter.com/EconomicsShiny' data-widget-id='526196846738165760'>Tweets by @EconomicsShiny</a> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document,'script','twitter-wjs');</script>"
shinyUI(fluidPage(#theme = "bootstrap3.css",
tags$head(includeScript("google-analytics.js")),
progressInit(),
navbarPage("Economic Dashboard",
tabPanel("Overview",
sidebarLayout(
sidebarPanel(
HTML("<a href='https://twitter.com/EconomicsShiny' class='twitter-follow-button' data-show-count='false'>Follow @EconomicsShiny</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>"),
htmlOutput("MarketUpdate.Commentary")
),
mainPanel(
HTML("<h3>GDP Growth: History And Projections For Major Economies</h3>
Charts show naive time-series forecasts for the next 4 quarters. All data shown as q/q growth rates (annualized).<p>Note: This page will take a few seconds to update the data."),
plotOutput("Overview.Charts"),
htmlOutput("UI.Date")
))),
navbarMenu("What's New?",
tabPanel("Latest On Twitter",
HTML(TwitterString)
),
tabPanel("Data Overview By Country",
sidebarLayout(
sidebarPanel(
uiOutput("UI.Country.Analysis"),
htmlOutput("Commentary.Country.Analysis")
),
mainPanel(
HTML("<h3>Longer-Term View</h3>"),
plotOutput("Charts.Country.Analysis")
)
)
)
),
navbarMenu("Monetary Policy",
tabPanel("US Monetary Policy",
sidebarLayout(
sidebarPanel(
HTML("<b>Latest FOMC Statement: Word Cloud</b>"),
imageOutput("FOMC.WordCloud"),
HTML("<b>FOMC Minutes: Word Cloud</b>"),
imageOutput("FOMC.Minutes.WordCloud" ),
plotOutput("Charts.FOMC", height = "750px")
),
mainPanel(
checkboxInput("ShowFOMCMinutes", "Show Minutes", FALSE),
h3("Latest FOMC Monetary Policy Statement"),
htmlOutput("FOMC.Current")
))),
tabPanel("US Treasury Interest Rates",
h3("Evolution of US Treasury Constant Maturity Rates (in %)"),
htmlOutput("US.InterestRates.Commentary"),
plotOutput("US.InterestRates.Dashboard", height="1000px")
),
tabPanel("International Inflation Comparison",
htmlOutput("International.InflationAnalysis.Dashboard")
)
),
navbarMenu("Economic Activity",
tabPanel("US Activity Surveys",
h3("High-Frequency Surveys of US Economic Activity"),
HTML("High-frequency indicators have some interesting properties. <ul><li>They provide an early snapshot of economic activity in different sectors of the US economy.
<li>Unlike GDP, which is only published quarterly and can be heavily revised,
these indicators are released monthly (and data revisions are small). <li>They are survey-based, and may thus exaggerate positive or negative sentiment.</ul><p>We have re-scaled the San Fransisco Fed Tech Pulse by multiplying it by 10.
You can zoom into the charts using the scroll wheel of the mouse or using the date range selector underneath the chart."),
htmlOutput("US.ActivityMeasures.Dashboard")
),
tabPanel("US GDP: Longer-Term View",
htmlOutput("US.GDP.LongTerm")
),
tabPanel("US Labor Market",
h3("US Labor Market Indicators: Current Values, Relative to the Worst Point This Cycle"),
h5("The large charts show the longer-term evolution since 2000; the small charts show progress among different labor market indicators during this recovery/expansion. The cycle is defined as starting in 2008;
current values are shown relative to the best and worst readings of this indicator during this cycle."),
plotOutput("US.LaborMarket.Dashboard", height="1000px")
),
tabPanel("US Commercial Banks",
htmlOutput("Banking.Dashboard")
),
tabPanel("US Housing Market",
htmlOutput("Housing.Dashboard")
),
tabPanel("US Vehicle Sales",
htmlOutput("VehiclesSales.Dashboard")
)
),
navbarMenu("Economic Forecasting",
tabPanel("Time Series Forecasting",
sidebarLayout(
sidebarPanel(
uiOutput("UI.Macro.Control"),
uiOutput("UI.Variable.Control")
),
mainPanel(
HTML("<h3>Time Series Forecasting: Comparison of Different Approaches</h3>"),
htmlOutput("Macro.Regression.Commentary"),
plotOutput("Macro.Chart"),
checkboxInput("UIRegressionSpecControl", "Show Regression Output", value=FALSE),
conditionalPanel(condition = "input.UIRegressionSpecControl",
HTML("Regression Specification (Arima Model, Lag Selection Based On AIC/BIC)"),
verbatimTextOutput("Macro.Regression")
)
)
)
),
tabPanel("Ensemble Forecasting",
sidebarLayout(
sidebarPanel(
selectInput("ForecastPooling.Selection",
"Select A Variable To Forecast",
c("GDP", "Nonfarm Payrolls") ),
htmlOutput("EnsembleForecast.Commentary")
),
mainPanel(
HTML("<h3>Ensemble Forecasting For GDP and Nonfarm Payrolls</h3>"),
checkboxInput("EnsembleForecastingDescChoice", "Show Model Description", FALSE),
HTML("<p>Below the in-sample fit; the box on the left provides details on the forecast for the next data release. The checkbox underneath the chart toggles the tracking information, i.e. how the forecast changed in response to new data."),
conditionalPanel(condition = "input.EnsembleForecastingDescChoice",
includeMarkdown("Description.EnsembleForecasting.md")),
plotOutput("EnsembleForecast.Plot"),
checkboxInput("EnsembleForecastingUpdateChoice", "Hide Tracking", FALSE),
conditionalPanel(condition = "!input.EnsembleForecastingUpdateChoice",
HTML("<p>The chart below shows how the forecast has changed in light of new data releases. The description on each bar
indicates the data; the table shows the additional details of the data release. Both chart and table are updated automatically as new information becomes available.<p>"),
plotOutput("EnsembleForecast.Tracking"),
verbatimTextOutput("Forecast.Tracking"))
))),
tabPanel("VAR Model of the US Economy",
htmlOutput("US.VARmodel.Dashboard")
)
),
tabPanel("Stock Market",
sidebarLayout(
sidebarPanel(
uiOutput("StockSelector"),
h5("Near-Real Time Quotes: Selected Stocks"),
tableOutput("Data.Realtime")
),
mainPanel(
plotOutput("TestPlot", height = "750px"),
h5("Historical Performance (Last 10 Trading Days):"),
tableOutput("LatestValue")
)
)
),
tabPanel("About",
includeMarkdown("About.md")
)
)))