Welfare cost of business cycles

Hi,

I have to get back to one of the earlier problems by Philipp, which is the following

Now, to find \chi, I did a second-order approximation of the right hand side of the last equation by hand and collected all the components which I need from the output of Dynare (steady state values of L and C, stochastic steady states of L and C and variances of L and C around the stochastic steady state). To check whether I did everything right, I calculated the right hand side also for regime B (in this case \chi is obviously 0) and compared the left hand side (which one can directly take from Dynare) to the right hand side. They should be the same, but they are not! Now, I don’t understand where the mistake is. Did I misunderstand the whole matter or did I for example make a mistake in getting the variances from Dynare (I tried two different versions). I checked my SO approx. various times, so I think it is correct.

I included my matlab file with which I did the comparison. It is based on the FA.mod file which can be found on Peter Karadi’s homepage.

Thanks a lot for your help!

FA_check.mod (7.9 KB)
welfarecheck.m (1.7 KB)