本文探討動態時間校正及聚類分析應用於台灣股票市場之實證研究。目前相關的分類機器學習模型用於股票市場的文獻,大多以預測報酬率為基礎,輔以使用財務資料或技術指標而成,為了要將報酬率分類,必須定義標籤類別,使得我們必須主觀界定各個報酬率類別的邊界。再者,相似報酬率的股票對應的財務資料或技術指標,往往在時間上有領先或落後,導致在區分股票標的相似程度有困難,因此,本研究探討並試圖解決時間序列領先或落後的辨識相似度問題,並捨去需要事先定義類別標籤的方法,將相似的股票做聚類分析。 本文研究動態時間校正計算股票走勢相似度,並使用聚類分析將股票分群,從中建立交易策略發想,並比較不同的聚類分析模型所對應的結果。其結果顯示,動態時間校正更能有效辨識實際相似的股票走勢,其克服時間序列相似卻不同步的問題;聚類分析用於股票分群也有很好的表現,有助於選出報酬較好的標的。
This paper discusses the application of dynamic time warping algorithm and cluster analysis for stock selection and trading strategy in Taiwan stock market. Recently, the researches of classification machine learning model which are used in the stock market are mostly based on the classification of the predicted rate of return, supplemented by the use of financial data or technical indicators. Therefore, it is necessary to define different categories of rates of return. Furthermore, the financial data or technical indicators corresponding to stocks with similar returns usually lead or lag in time, which makes it difficult to distinguish the similarity of stocks. Therefore, we expect to solve the identification similarity of leading or lagging time series problems, and cluster the similar stocks. In this paper, dynamic time warping algorithm is used to calculate the level of similarity in the trend of stocks, and cluster analysis is used to group the stocks. And then, we build an empirical study of stock selection strategies, and compare the difference of clustering analysis models. The result shows that the dynamic time warping algorithm can more effectively identify the actual similar stock trends, and the cluster models we used also have good performance for stocks grouping, which help to select stocks with better returns.