# Perfect foresight and solver instead of stoch stimul for carbon tax policy

**URL:** <https://forum.dynare.org/t/perfect-foresight-and-solver-instead-of-stoch-stimul-for-carbon-tax-policy/25489>\
**Category:** Perfect foresight simulations\
**Created:** [5 April 2024 06:53 UTC](https://forum.dynare.org/t/perfect-foresight-and-solver-instead-of-stoch-stimul-for-carbon-tax-policy/25489 "2024-04-05T06:53:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anna389](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/e495f1/32.png) [@Anna389](https://forum.dynare.org/u/Anna389)\
**Post date:** [5 April 2024 06:53 UTC](https://forum.dynare.org/t/perfect-foresight-and-solver-instead-of-stoch-stimul-for-carbon-tax-policy/25489/1 "2024-04-05T06:53:25Z")

</div>

Hi, I am having an issue with replacing stoch\_stimul with a perfect\_foresight command.

If the carbon tax increases overtime rather than being temporary, inflation goes down. If I have tax as a demand shock as it reduces output and inflation so phie\>0 should mitigate inflation fall however to do this I need to use perfect\_foresight command rather than stoch\_stimul as the shock is not temporary.

I am trying to use perfect\_foresight\_setup and solver however i am having trouble saving the data as IRFs. What can I do to replace the stoch\_stimul and plot inflation over the period? I have commented out the attempt at the bottom of the code.

Thank you

[plot\_envnew.mod](https://forum.dynare.org/uploads/short-url/drVH0oVMpmyQ8Krff5PmOFZAgTG.mod) (6.1 KB)  
[console\_env.m](https://forum.dynare.org/uploads/short-url/o8OfC9lNy9SKpXnXUNzCSqkJDf7.m) (3.6 KB)

---

<div class="post-metadata">

**Author:** ![stepan-a](https://forum.dynare.org/user_avatar/forum.dynare.org/stepan-a/32/6652_2.png) [@stepan-a](https://forum.dynare.org/u/stepan-a)\
**Post date:** [5 April 2024 16:16 UTC](https://forum.dynare.org/t/perfect-foresight-and-solver-instead-of-stoch-stimul-for-carbon-tax-policy/25489/2 "2024-04-05T16:16:18Z")

</div>

Hi,

the script `consol_env` (used to generate a file loaded in the mod file) is not working because `file_steady_env` function is missing. Can you post the missing file?

Best,  
Stéphane

---

<div class="post-metadata">

**Author:** ![Anna389](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/e495f1/32.png) [@Anna389](https://forum.dynare.org/u/Anna389)\
**Post date:** [6 April 2024 04:08 UTC](https://forum.dynare.org/t/perfect-foresight-and-solver-instead-of-stoch-stimul-for-carbon-tax-policy/25489/3 "2024-04-06T04:08:16Z")

</div>

Sorry about that

[find\_steady\_env.m](https://forum.dynare.org/uploads/short-url/syYuzLiIExB6yRw7NG3xoZLCUzu.m) (910 Bytes)

---

<div class="post-metadata">

**Author:** ![stepan-a](https://forum.dynare.org/user_avatar/forum.dynare.org/stepan-a/32/6652_2.png) [@stepan-a](https://forum.dynare.org/u/stepan-a)\
**Post date:** [6 April 2024 07:38 UTC](https://forum.dynare.org/t/perfect-foresight-and-solver-instead-of-stoch-stimul-for-carbon-tax-policy/25489/4 "2024-04-06T07:38:47Z")

</div>

I modified the mod file to produce an IRF for inflation (with a shock on vtau in period one). I changed the number of periods for the perfect foresight (40 is probably too short, the simulation is done under the assumption that the economy is back to the steady state in the last period). After the call to `perfect_foresight_solver` I put the generated paths in a `dseries` object and call the `plot` command:

```matlab
irfs_vtau = dseries(transpose(oo_.endo_simul), '0Q4', M_.endo_names);
plot(irfs_vtau.pi.data(1:80))

```

 ![image](https://forum.dynare.org/uploads/default/original/3X/6/2/623cb5c11705fc5e8057ecd1509e982cd5c61129.png)

You can modify the `shocks` block to add an expected path for the exogenous variable.

Best,  
Stéphane.

[plot\_envnew.mod](https://forum.dynare.org/uploads/short-url/uBoyMQhorlPFYDueS1sqtbnZzrj.mod) (5.6 KB)

---

<div class="post-metadata">

**Author:** ![stepan-a](https://forum.dynare.org/user_avatar/forum.dynare.org/stepan-a/32/6652_2.png) [@stepan-a](https://forum.dynare.org/u/stepan-a)\
**Post date:** [7 April 2024 05:54 UTC](https://forum.dynare.org/t/perfect-foresight-and-solver-instead-of-stoch-stimul-for-carbon-tax-policy/25489/6 "2024-04-07T05:54:04Z")

</div>

Not knowing the model, I cannot say.

Best,  
Stéphane

P.S. Unrelated, are you sure that in the Taylor rule the current interest rate should depend on the expected interest rate (instead of the lagged interest rate)?

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [7 April 2024 07:04 UTC](https://forum.dynare.org/t/perfect-foresight-and-solver-instead-of-stoch-stimul-for-carbon-tax-policy/25489/7 "2024-04-07T07:04:19Z")

</div>

Why already has that discussion in various iterations of the file. In a general equilibrium model, there is not a one-to-one mapping from parameters to the model solution. It’s not a priori evident what the effect of a change in `phie` on inflation should be, particularly if the Taylor rule is more complicated. The feedback of the interest rate on Carbon will affect e.g. output, which in turn enters the Taylor rule. That results in non-trivial feedback loops.
