Forecast instruction - second order approximation

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Forecast instruction - second order approximation

Postby fravenna » Wed Oct 11, 2006 7:05 am

The model I am using includes a variable (1) that is the expected discounted sum of another endogenous variable (2). When using the instruction 'forecast' with the second order approximation, the forecasted path of variable (1) increases, while variable (2) at time 1 decreases. This seems odd since variable (2) is just the expected discounted sum of (1), written as a difference equation.
The forecast with the first order approximation delivers instead the expected result (it is easy to check analitycally). Is there something conceptually different in computing forecast with the second order approximation? Has the loop in simultxdet.m been tested for the sceond order forecast?

Also, when using forecast with second order, I have to set the 'periods' option in forecast at a value quite larger than the number of periods for which I supply values for the exogenous deterministic shock, else the forecast is computed ignoring a portion of the supplied values.

many thanks
fravenna
 
Posts: 9
Joined: Tue Jul 04, 2006 1:28 am
Location: santa cruz

Postby brazdik » Wed Oct 11, 2006 10:49 am

Regarding the loop for second order forecast, after consultation with Michel and Ondra, we found out that in simultexdet.m the following line (probably #82 in code):

for j=1:min(iter+ykmin_-i-M_.ex_det_length+1,M_.ex_det_length)

should be changed to:
for j=1:min(ykmin_-i+M_.ex_det_length+1,M_.ex_det_length)

The corrected code is in attachment. Does it solve your problem?
Attachments
simultxdet.m
corrected loop for second order forecast
(4.19 KiB) Downloaded 147 times
brazdik
 
Posts: 3
Joined: Mon Aug 01, 2005 9:31 am
Location: Prague

Forecast-second order approximation: Problem still persists

Postby fravenna » Wed Oct 11, 2006 3:33 pm

Thanks for the reply

a) the main problem still is unaffected, I obtain exactly the same numbers as with the earlier code. {which makes me think there is something amiss, since the loop in simultxdet.m is clearly changed}:

"" The model I am using includes a variable (1) that is the expected discounted sum of another endogenous variable (2). When using the instruction 'forecast' with the second order approximation, the forecasted path of variable (1) increases, while variable (2) at time 1 decreases. This seems odd since variable (2) is just the expected discounted sum of (1), written as a difference equation.
The forecast with the first order approximation delivers instead the expected result (it is easy to check analitycally). Is there something conceptually different in computing forecast with the second order approximation? Has the loop in simultxdet.m been tested for the sceond order forecast? ""

any other idea? I am still very puzzled.

b) The new simultxdet.m does solve this second issue I mentioned:

"" Also, when using forecast with second order, I have to set the 'periods' option in forecast at a value quite larger than the number of periods for which I supply values for the exogenous deterministic shock, else the forecast is computed ignoring a portion of the supplied values. ""
fravenna
 
Posts: 9
Joined: Tue Jul 04, 2006 1:28 am
Location: santa cruz

Postby MichelJuillard » Wed Oct 11, 2006 3:51 pm

Can you post the example?

Note that in a forecast based on 2nd order approximation, the forecast doesn't converge back to the deterministic steady state because of the shift effect from taking into account future volatility.

Best

Michel
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am

Forecast instruction - example

Postby fravenna » Wed Oct 11, 2006 7:54 pm

I include a modification of the Dynare sample RBC model where a deterministic productivity shock 'ebs' has been added, a variable 'ut' describes the value of the istantaneous utility, a variable 'v' describes the expected discounted sum of instantaneous utility.

What happens using FORECAST with two sample paths for deterministic productivity shock, one of 50 periods and one of 100 periods. 2nd order:

1) I compared the path of 'ut' in the two forecasts. I have to revise my earlier statement - in this sample model 'ut' for the 100 period forecast is not uniformely above the path for the 50 periods forecast; so it may very well occur that 'v' is larger in the 50 periods forecast.

2) Here is where I am puzzled (or simply something very basic is just escaping my mind): since 'v' is the objective function to be optimized, I would expect it to be larger when productivity is above steady state for a longer period. The opposite occurs in the Forecast exercise.

3) Using a first order approximation, 'v' is indeed higher when productivity is above steady state for a longer period. Why is the result reversed using the second order approximation? I am thinking that up to first order certainty-equivalence ensures the result, while at second order I am using a stochastic model to determine the outcome of a determinist shock - the correct experiment would be to simulate the model including stochastic shocks together with the deterministic shock.
Yet when setting the variance of the shocks to zero and repeating the exercise, I still obtain the same puzzling result with the second order approximation, and I cannot explain this.
Attachments
example2_modified.mod
(3.37 KiB) Downloaded 209 times
fravenna
 
Posts: 9
Joined: Tue Jul 04, 2006 1:28 am
Location: santa cruz

Postby MichelJuillard » Wed Oct 11, 2006 8:14 pm

thanks. I will try to look at it next week.

Best

Michel
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am

Clarification

Postby fravenna » Wed Oct 11, 2006 8:47 pm

When I say " I expect 'v' to be larger..." what I refer to is the forecast of 'v' at time 1
fravenna
 
Posts: 9
Joined: Tue Jul 04, 2006 1:28 am
Location: santa cruz

Update

Postby fravenna » Fri Oct 20, 2006 7:36 pm

is there an update on this Question?

Many thanks
fravenna
 
Posts: 9
Joined: Tue Jul 04, 2006 1:28 am
Location: santa cruz

Postby MichelJuillard » Sat Oct 21, 2006 3:13 pm

This is a bit puzzling. One observes however, that when productivity goes back to the original steady state after 50 or 100 periods, there is a huge increase in period utility because agents work less and start depleting the stock of capital accumulated during the productivity boom. Of course, this occurs closer to now in the 50 period case than in the 100 period one and accounts more in welfare (current value of future utility).
Now, I can't explain why it works in one direction in the linear approximation case and in the other in the 2nd order. Nor can I say which of the two is the better approximation. Remember that a 2nd order approximation isn't always a better approximation than a 1st order one, particularily when on gets further from the steady state.
It is challenging to remark that it is indeed still difficult to rank from a welfare point of view the two rather simple scenarios that you are proposing.

Kind regards

Michel
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am

On the Puzzling Welfare Result

Postby fravenna » Mon Oct 23, 2006 8:48 pm

Dear Michel,

Thanks for your reply. I agree on all counts - and on your puzzlement at the results.

The last question which is left unanswered is why DYNARE predicts that in a RBC model welfare improves when productivity is above steady state for a shorter, rather than longer, period of time.

That seems to run against basic intuition. Here is where my intuition could be flawed, and I would like to know your opinion, or the one of other forum participants. The problem I have in mind when building intuition is the one of an infinite horizon recursive model. Therefore if the expected value of productivity were higher, DYNARE should predict a higher welfare. But when running the FORECAST exercise I am basically looking at a finite horizon problem (solved, I assume, by backward induction). Therefore the policy function is not recursive. Since the terminal condition implies a large increase in utility when productivity goes back to steady state, there is no reason to expect that welfare should be higher when productivity is above steady state for a longer period.

The fact that discounted sum of per-period utility is larger when productivity is above steady state for a shorter period does not imply that this plan is available when productivity is above steady state for a longer period.

Regards
fravenna
 
Posts: 9
Joined: Tue Jul 04, 2006 1:28 am
Location: santa cruz


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 10 guests