More resources, including demos and videos, for implementing and speeding up Monte Carlo simulations in both MATLAB and Simulink man be found here:
The logic of your program is very clear but I still have few questions. Hope you can give me some hints.
1. Why did you use VarY in step 5 but not the variance of the short rate?
2. In eqn c.11, why the first term is missed comparing to the eqn.76 in the paper?
3. How did you deal with the R matrix?
Do you have an updated file? If yes, could you upload the file or send a copy to me?
Thanks in advance!
04 Feb 2012
Granger Causality Test
Conducts a Granger Causality test using the Bayesian Information Criterion to select lag length
This function uses Matlab function "regress" which assumes a constant term(intercept) in the linear regression and therefore violates Granger causality definition(See Granger's original paper, Econometrica 37:3 424-438, 1969).
I applied this function on two random numbers series (10 time points, lag = 2) and repeated 1000 times (every time the two series are different), and set the alpha value as 0.05. Among the 1000 tests, 400 were found to have "Granger causality"! So I think the result is not reliable.