隐马尔科夫模型(Hidden Markov Model)在诸多领域都有广泛应用.本文从不同角度对现有的HMM进行改进并应用于金融预测.首先,我们采取固定K-means方法的初始点,使得K-means的聚类结果更加稳定,由此为Baum-Welch算法确定更好的初始迭代值.其次,为更进一步提升预测效果,与已有方法不同,我们将由BaumWelch算法所得到的模型参数值作为Vertibi算法的输入来确定隐状态的最优取值序列,由此重新划分观测向量,进而得到各个隐状态对应的观测向量的集合;基于Vertibi算法的输出结果,我们重新计算不同类观测向量的均值与方差,将新的均值向量和协方差矩阵作为Baum-Welch算法初始迭代值,最终确定HMM最优的模型参数.最后,代替现有方法仅在历史区间中简单寻求相似走势的做法,我们不仅导出了预测值发生的多步条件概率的精细表达式,而且通过极大化该条件概率的值来得到更佳的预测值.基于中国证券市场具体数据的实证结果表明了本文所提出改进HMM的优越性.
Hidden Markov model(HMM) has been widely applied to many fields. This paper tries to improve current HMMs from different aspects and then applies the improved HMM to financial forecasting. Firstly, by fixing the initial points for the K-means clustering algorithmso that its clustering results are more stable, we use the resulting K-means clustering algorithm to seek better initial values for the Baum-Welch algorithm. To improve the forecasting accuracy, we apply the following new techniques: we choose the model parameters obtained from the Baum-Welch algorithm as the inputs for the Vertibi algorithm to determine the optimal sequence of the hidden states, and we repartition the observing vector. Then we determine the sets of observing vectors corresponding to the different hidden states. Based on the outputs of the Vertibi algorithm, we recompute the means and variances of different classes of observing vectors. The resulting mean vector and variance-covariance matrix are taken as the initial values for the Baum-Welch algorithm, which finally finds the optimal model parameters for HMM. Last but not least, instead of the existing methods seeking similar movements of the practice in the historical interval, we not only obtain the fine expression step of conditional probability, and by maximizing the conditional probability values, we derive better predictive value. Numerical results based on the real trading data of Chinese stock markets indicate the superiority of the improved HMM.