# How to calculate and analyze the IRF of the correlation between two variables in Dynare

Hello, everybody.
How can I calculate and analyze the IRF of the correlation between two variables in Dynare?
In Basu and Bundick (2017) paper (“Uncertainty shocks in a model of effective demand”), they calculate the IRF of volatility, which is showns as the IRF of model implied stock market volatiltiy.
"
vxo_evola = 100sqrt(4(max(varexpre_evola+varexpre_sss,1e-16)));
vxo_ea = 100sqrt(4(max(varexpre_ea+varexpre_sss,1e-16)));
vxo_ez = 100sqrt(4(max(varexpre_ez++varexpre_sss,1e-16)));

vxo_sss = 100sqrt(4(varexpre_sss));

logvxo_evola = log(vxo_evola./ vxo_sss);
logvxo_ea = log(vxo_ea./ vxo_sss);
logvxo_ez = log(vxo_ez./ vxo_sss);
"
How can I calculate and analyze the IRF of the correlations between endogenous variables, for example, the IRF of the correlation between price of equity and investment ?
Their codes are attached below.
Thanks a lot !

bbeffectivedemandmodelsupportvar.mod (7.9 KB)
irfsss.m (1.9 KB)
sss.m (1.3 KB)

I am not sure I understand. The IRFs are about the conditional movement of the level of variables. Now you want the IRF of a particular moment related to endogenous variable? I am not sure that is feasible. I guess it must be a conditional future correlation.

Yes, it’s the conditional future correlation, just like the implied stock market volatility response of uncertainty shock.

For example, I want to analysis the influnce of unceratinty shock on the correlation between stock price and investment. How can I construct the impulse responses of the correlation between stock price and investment to uncertainty shock?

In Basu and Bundick (2017), they construct the impulse response of model implied stock market volatility to uncertainty shock.