Bivariate models: the bivariate state-space model with Markov-switching is coded in Matlab. The code is available and will be uploaded here after receiving the results of my paper submission, though the code can be shared upon request.
About the MATLAB code: I model the asymmetry by using a first-order Markov-switching process as in Hamilton (1989) and estimate the bivariate state-space model by using Kalman’s (1960) filter. In the presence of a Markov- switching process of Hamilton, to make the Kalman filter operable, I use Kim's (1944) approximate maximum likelihood method. The code is flexible and by changing matrices in the state-space model, one can adjust and repurpose the code for other studies, which requires specifying a Markov-switching process. In particular, there is a separate code for the following models:
Bivariate state-space model with Markov-switching with correlated shocks
Bivariate state-space model with Markov-switching with uncorrelated shocks
Bivariate state-space model without Markov-switching with correlated shocks. This replicates a part of Gonzalez-Astudillo and Roberts (2022).
Bivariate state-space model without Markov-switching with uncorrelated shocks. This replicates Clark (1989) and Grant (2018).
Note1: All models can accommodate either time-varying trend growth or a structural break in trend growth.
Note 2: I provide the Pythone and R versions of this code as well.
Univariate models: the univariate state-space model with Markov-switching is also coded in Matlab. In particular, the code can repicate the following models:
Univariate state-space model with Markov-switching with correlated shocks, which replicates Sinclair (2010).
Univariate state-space model with Markov-switching with uncorrelated shocks, which replicates Kim and Nelson (1999)
Univariate state-space model without Markov-switching with correlated shocks, which replicates Morley et al. (2003).
Univariate state-space model without Markov-switching with uncorrelated shocks, which replicates Clark (1989), Grant and Chan (2017), etc.
Note1: All models can accommodate either time-varying trend growth or a structural break in trend growth.
Note 2: I provide the Pythone and R versions of this code as well.
Univariate model: the univariate state-space model with Markov-switching is coded in Matlab. The code is available and will be uploaded here after receiving the results of my paper submission, though the code can be shared upon request.
About the MATLAB code: The methodology used in paper 2 is similar to that of used in paper 1. The code is designed to characterize the efficient price and in the stock market and also deviations from efficient price. BTW, the code is flexible since by changing matrices in the state-space model, you can repurpose the code for other studies. In particular, there is a code for the following models:
Univariate state-space model with Markov-switching with correlated shocks.
Univariate state-space model with Markov-switching with uncorrelated shocks. This is similar to the model proposed by Turner et al. (1989), Kim and Kim (1996), and Liu et al. (2012). The distinction is that my model is specified at levels rather than differences.
Univariate state-space model without Markov-switching with correlated shocks.
Univariate state-space model without Markov-switching with uncorrelated shocks. This replicates the work of Shiller et al. (1984), Summers (1986), Fama and French (1988), Poterba and Summers (1988).
Note1: All models can accommodate either time-varying long-run return or a constant long-run return.
Note 2: I provide the Pythone and R versions of this code as well.