QuantumLearner commited on
Commit
b4a7e3a
·
verified ·
1 Parent(s): c2a5423

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -20
app.py CHANGED
@@ -107,12 +107,14 @@ st.title('Pattern Recognition in Asset Prices')
107
 
108
  # Sidebar for method selection
109
  st.sidebar.title("Input Parameters")
110
- st.sidebar.subheader("How to Use")
111
- st.sidebar.markdown("""
112
- 1. Select the pattern recognition method you want to use.
113
- 2. Set the stock ticker or crypto pair, date range, and other parameters.
114
- 3. Click 'Run' to perform the analysis.
115
- """)
 
 
116
 
117
  # Grouping and expanding sidebar options with tooltips
118
  with st.sidebar.expander("Pattern Recognition Methods", expanded=True):
@@ -305,20 +307,24 @@ if st.sidebar.button('Run Analysis'):
305
  if selected == "DTW Pattern Recognition":
306
  st.markdown("""
307
  ### DTW Pattern Recognition
308
- Dynamic Time Warping (DTW) is a method that measures the similarity between two time series that may vary in time or speed. DTW aligns the time series by warping the time axis to minimize the distance between them. This method could potentially identify historical periods that have similar patterns to the current stock price pattern by comparing their shapes, regardless of possible distortions in the time axis.
309
- The DTW distance \( D \) between two time series \( X \) and \( Y \) is calculated as:
310
- """)
311
- st.latex(r'''
312
- D(i, j) = \text{dist}(X_i, Y_j) + \min \begin{cases}
313
- D(i-1, j) \\
314
- D(i, j-1) \\
315
- D(i-1, j-1)
316
- \end{cases}
317
- ''')
318
- st.markdown("""
319
- where {dist}(Xi, Yj) is the distance between points (Xi) and (Yj), and D(i, j) is the accumulated cost.
320
-
321
- **Results:**
 
 
 
 
322
  The left chart shows the entire stock price data with the identified patterns highlighted. The right chart shows the reindexed price patterns for comparison.
323
  """)
324
  if st.session_state.results_dtw:
 
107
 
108
  # Sidebar for method selection
109
  st.sidebar.title("Input Parameters")
110
+
111
+ with st.sidebar.expander("How to Use", expanded=False):
112
+ #st.sidebar.subheader("How to Use")
113
+ st.sidebar.markdown("""
114
+ 1. Select the pattern recognition method you want to use.
115
+ 2. Set the stock ticker or crypto pair, date range, and other parameters.
116
+ 3. Click 'Run' to perform the analysis.
117
+ """)
118
 
119
  # Grouping and expanding sidebar options with tooltips
120
  with st.sidebar.expander("Pattern Recognition Methods", expanded=True):
 
307
  if selected == "DTW Pattern Recognition":
308
  st.markdown("""
309
  ### DTW Pattern Recognition
310
+ Dynamic Time Warping (DTW) is a method that measures the similarity between two time series that may vary in time or speed. """)
311
+
312
+ with st.expander("Click here to read more about the methodology"):
313
+ st.markdown("""DTW aligns the time series by warping the time axis to minimize the distance between them. This method could potentially identify historical periods that have similar patterns to the current stock price pattern by comparing their shapes, regardless of possible distortions in the time axis.
314
+ The DTW distance \( D \) between two time series \( X \) and \( Y \) is calculated as:
315
+ """)
316
+ st.latex(r'''
317
+ D(i, j) = \text{dist}(X_i, Y_j) + \min \begin{cases}
318
+ D(i-1, j) \\
319
+ D(i, j-1) \\
320
+ D(i-1, j-1)
321
+ \end{cases}
322
+ ''')
323
+ st.markdown("""
324
+ where {dist}(Xi, Yj) is the distance between points (Xi) and (Yj), and D(i, j) is the accumulated cost.
325
+ """)
326
+
327
+ st.markdown("""**Results:**
328
  The left chart shows the entire stock price data with the identified patterns highlighted. The right chart shows the reindexed price patterns for comparison.
329
  """)
330
  if st.session_state.results_dtw: