This Julia module implements the Markov-Switching Multifractal model of Calvet, L. E. and Fisher, A. J. (2004). How to Forecast Long-Run Volatility: Regime Switching and the Estimation of Multifractal Processes. Journal of Financial Econometrics, 2(1):49-83.
The code can be used to run the module on a time-series of returns, as well as on the residuals of an ARMA(1,1) process.
Load the module
using MSMSimulate a return series by setting the parameters of the process. The number of states is given by
kbar = 5 The parameter controling the binomial distribution from which the states are drawn is
m0 = 1.6The state transition probabilities are given by
b = 1.1
γ₀ = 0.5Finally,
σ = 2.0/sqrt(252)The number of time periods is given by
T = 2000To simulate the process, we can use the function
data = MSM.simulate(b,m0,γ₀,σ,kbar,T)and to estimate the parameters
ψ = MSM.estimate(data,kbar,scale)