In this paper, we describe and implement two recursive filtering algorithms, the optimized particle filter, and the Viterbi algorithm, which allow the joint estimation of states and parameters of continuous-time stochastic volatility models, such as the Cox Ingersoll Ross and Heston model. In practice, good parameter estimates are required so that the models are able to generate accurate forecasts. To achieve the objectives the proposed algorithms were implemented using daily empirical data from the time series of the $S\&P500$ returns of the stock exchange index. The proposed methodology facilitates computational calculations of the marginal likelihood of states and allows the reconstruction of unknown states in a suitable way, and reliable estimation of the parameters. To measure the quality of estimation of the algorithms, we used the square root of the mean square error and relative deviation standard as measures of goodness of fit. The estimated errors are insignificant for the analyzed data and the two models considered. We also calculated the execution times of the algorithms, demonstrating that the Viterbi algorithm has less execution time than the optimized particle filter.
Read full abstract