QuantumLearner commited on
Commit
0505bb0
·
verified ·
1 Parent(s): 0265ce3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -100,7 +100,7 @@ def plot_forecast(merged_data, future_dates, volatility_predictions, lower_volat
100
  # Plot predicted volatility
101
  fig.add_trace(go.Scatter(x=future_dates, y=volatility_predictions, mode='lines',line_color='orange' ,name='Predicted Volatility', line=dict(dash='dot', width=4)))
102
 
103
- fig.update_layout(title='VAR Predicted Volatility with Confidence Intervals',
104
  xaxis_title='Date', yaxis_title='Volatility',
105
  template='plotly_white')
106
 
@@ -180,7 +180,7 @@ def plot_residuals_plotly(results):
180
  for col in residuals.columns:
181
  fig.add_trace(go.Scatter(x=residuals.index, y=residuals[col], mode='lines', name=f'Residuals: {col}'))
182
 
183
- fig.update_layout(title='Residuals of VAR Model',
184
  xaxis_title='Date', yaxis_title='Residuals',
185
  template='plotly_white')
186
  return fig
@@ -369,7 +369,7 @@ if page == "Real-time Predictions":
369
  plot_placeholder = st.empty()
370
 
371
  if run_button:
372
- with st.spinner("Downloading data and processing..."):
373
  data = download_data(tickers, start_date_rt, end_date_rt)
374
  data = calculate_returns_and_volatility(data, rolling_window)
375
  merged_data = merge_data(data)
@@ -467,7 +467,7 @@ elif page == "Model Performance":
467
  error_placeholder = st.empty()
468
 
469
  if run_button:
470
- with st.spinner("Downloading data and processing..."):
471
  # Convert end_date_mp to datetime if necessary
472
  adjusted_end_date = pd.to_datetime(end_date_mp)
473
 
 
100
  # Plot predicted volatility
101
  fig.add_trace(go.Scatter(x=future_dates, y=volatility_predictions, mode='lines',line_color='orange' ,name='Predicted Volatility', line=dict(dash='dot', width=4)))
102
 
103
+ fig.update_layout(title='Predicted Volatility with Confidence Intervals',
104
  xaxis_title='Date', yaxis_title='Volatility',
105
  template='plotly_white')
106
 
 
180
  for col in residuals.columns:
181
  fig.add_trace(go.Scatter(x=residuals.index, y=residuals[col], mode='lines', name=f'Residuals: {col}'))
182
 
183
+ fig.update_layout(title='Residuals of Model',
184
  xaxis_title='Date', yaxis_title='Residuals',
185
  template='plotly_white')
186
  return fig
 
369
  plot_placeholder = st.empty()
370
 
371
  if run_button:
372
+ with st.spinner("Downloading data and processing (This will take a few seconds)..."):
373
  data = download_data(tickers, start_date_rt, end_date_rt)
374
  data = calculate_returns_and_volatility(data, rolling_window)
375
  merged_data = merge_data(data)
 
467
  error_placeholder = st.empty()
468
 
469
  if run_button:
470
+ with st.spinner("Downloading data and processing predictions (This will take a few seconds)..."):
471
  # Convert end_date_mp to datetime if necessary
472
  adjusted_end_date = pd.to_datetime(end_date_mp)
473