Hansen's (1992) specification test for Markov regimes
Posted: Thu May 24, 2012 3:55 am
Hello everyone,
I encountered a small problem while writing the Likelihood Ratio Test under nonstandard conditions as outlined by Hansen (1992) (http://ideas.repec.org/a/jae/japmet/v7y ... 61-82.html). I want to test whether I need n or n+1 states in my Markov chain. As might be well-known, the critical values of the LR test do not follow a chi-squared distribution due to the nuisance parameters involved. A careful review of the forum and the available procedures for RATS makes me believe that there is no ready-made solution. Is that correct?
The test is, however, fairly simple to implement from my point of view. Hansen suggests to standardize the LR test statistic by the standard deviation of the single log likelihoods ratios for the single observations. And there is the problem. Somewhere in the maximum likelihood estimation procedure of the Markov regime-switching model's EM algorythm, RATS calculates the log likelihoods to sum them up and to get to the overall log likelihood for the estimation. Is it possible to call these up? Because the model converged and, hence, they should be there. From my point of view, it should be easy to run both models, the one with n and the other with n+1 states, save the single likelihoods, calculate the standard deviation of the differences and then standardize the LR statistic.
Alternatively, I already tried to calculate the log-likelihood ratios manually by using the residuals and the explained variable of my regression, but it didn't work. I encounter some errors due to the fact that some errors (msregu) are larger than the y-variable eventually leading to values larger than 1, which cannot be used in a log.
I hope that my problem became clear. Otherwise, please comment on it and I'll respond and clarify whatever might unclear.
I encountered a small problem while writing the Likelihood Ratio Test under nonstandard conditions as outlined by Hansen (1992) (http://ideas.repec.org/a/jae/japmet/v7y ... 61-82.html). I want to test whether I need n or n+1 states in my Markov chain. As might be well-known, the critical values of the LR test do not follow a chi-squared distribution due to the nuisance parameters involved. A careful review of the forum and the available procedures for RATS makes me believe that there is no ready-made solution. Is that correct?
The test is, however, fairly simple to implement from my point of view. Hansen suggests to standardize the LR test statistic by the standard deviation of the single log likelihoods ratios for the single observations. And there is the problem. Somewhere in the maximum likelihood estimation procedure of the Markov regime-switching model's EM algorythm, RATS calculates the log likelihoods to sum them up and to get to the overall log likelihood for the estimation. Is it possible to call these up? Because the model converged and, hence, they should be there. From my point of view, it should be easy to run both models, the one with n and the other with n+1 states, save the single likelihoods, calculate the standard deviation of the differences and then standardize the LR statistic.
Alternatively, I already tried to calculate the log-likelihood ratios manually by using the residuals and the explained variable of my regression, but it didn't work. I encounter some errors due to the fact that some errors (msregu) are larger than the y-variable eventually leading to values larger than 1, which cannot be used in a log.
I hope that my problem became clear. Otherwise, please comment on it and I'll respond and clarify whatever might unclear.