I have fit a simple bi-variate VAR model to this data set and I want to run the QLR test to check for coefficient stability over time. I looked through the “strucchange” package but could not figure it out how to actually run a simple QLR test.
Could any R-pro in time series help me with that. Many thanks.!
var.est_2 <- VAR(z.train, ic= "FPE", type = "const") # var.est_2 has the estimates of VAR
The QLR test is just the maximum F-statistic from the Chow test over a certain sample. The Fstats() function gives you exactly what you want. Here is an example using the Phillips curve:
The black line in the plot is the set of F-statistics. The maximum F-stat is the QLR stat. The Red line is the critical value based on Andrews (1993) and Hansen (1997). In this case, we would fail to reject the null that there is no structural change. I’m not sure how nicely strucchange plays with the vars package. But since the VARs can be estimated line by line, you can simply re-estimate each equation using lm() and then apply the Fstats() function. Also, look at section 5 of this paper: http://www.jstatsoft.org/v07/i02/paper
They have another example using an error correction model.