# Lmmcp: starting from a solution

**URL:** <https://forum.dynare.org/t/lmmcp-starting-from-a-solution/16953>\
**Category:** Perfect foresight simulations\
**Created:** [18 November 2020 12:26 UTC](https://forum.dynare.org/t/lmmcp-starting-from-a-solution/16953 "2020-11-18T12:26:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![leonard007](https://forum.dynare.org/letter_avatar_proxy/v4/letter/l/c4cdca/32.png) [@leonard007](https://forum.dynare.org/u/leonard007)\
**Post date:** [18 November 2020 12:26 UTC](https://forum.dynare.org/t/lmmcp-starting-from-a-solution/16953/1 "2020-11-18T12:26:26Z")

</div>

Dear Professor Pfeifer,  
I start from the solution without the constraint, which works perfectly, to solve my model as following

> perfect\_foresight\_setup(periods=250);  
> perfect\_foresight\_solver(tolf=1e-8);  
> perfect\_foresight\_solver(lmmcp);

but it is still not enough for the constraint

> [mcp = ‘phis@{i} \< 2.50’]

so I was wondering if I can use the solution of [mcp = ‘phis@{i} \< 2.55’] (instead of the model with no constraint, for example) to solve [mcp = ‘phis@{i} \< 2.50’]. Is it possible? and if yes, what are the right codes?  
Thank you so much,

Kind regards,  
Leo

---

<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:** [18 November 2020 21:46 UTC](https://forum.dynare.org/t/lmmcp-starting-from-a-solution/16953/2 "2020-11-18T21:46:21Z")

</div>

You would need to do this in a separate mod-file. After running the model with the lower constraint, Dynare will save the results in `oo_.endo_simul` in the `_results.mat`-file.  
In the one with the tighter constraint, first call `perfect_foresight_setup`, then load the results.

In a nutshell:

> [@Optimal Monetary Policy with nonlinear loss function](https://forum.dynare.org/t/optimal-monetary-policy-with-nonlinear-loss-function/5951/11):
>
> Occbin does only work with linear models. What I was suggesting is to solve the model without the constraint and save the solution from oo\_.endo\_simul . Then run perfect\_foresight\_setup with the constraint, load the previous results into oo\_.endo\_simul and then run perfect\_foresight\_solver

---

<div class="post-metadata">

**Author:** ![leonard007](https://forum.dynare.org/letter_avatar_proxy/v4/letter/l/c4cdca/32.png) [@leonard007](https://forum.dynare.org/u/leonard007)\
**Post date:** [19 November 2020 12:46 UTC](https://forum.dynare.org/t/lmmcp-starting-from-a-solution/16953/3 "2020-11-19T12:46:09Z")

</div>

Thank you so much. So just to be sure:  
First I run the model (let’s say model\_1) with [mcp = ‘phis@{i} \< 2.55’], then the mod file of model\_2 with [mcp = ‘phis@{i} \< 2.50’] in which we have

> perfect\_foresight\_setup(periods=250);  
> load model\_1\_results oo\_.endo\_simul;  
> perfect\_foresight\_solver(lmmcp);

is this correct?  
Thank you for your time  
Kind regards,  
Leo

---

<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:** [19 November 2020 13:36 UTC](https://forum.dynare.org/t/lmmcp-starting-from-a-solution/16953/4 "2020-11-19T13:36:21Z")

</div>

Do

```auto
perfect_foresight_setup(periods=250);
temp=load('model_1_results');
oo_.endo_simul=temp.oo_.endo_simul;
perfect_foresight_solver(lmmcp);

```
