# Stack\_solve\_algo

**URL:** <https://forum.dynare.org/t/stack-solve-algo/18085>\
**Category:** Perfect foresight simulations\
**Created:** [12 May 2021 18:49 UTC](https://forum.dynare.org/t/stack-solve-algo/18085 "2021-05-12T18:49:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![andre](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/6de8d8/32.png) [@andre](https://forum.dynare.org/u/andre)\
**Post date:** [12 May 2021 18:49 UTC](https://forum.dynare.org/t/stack-solve-algo/18085/1 "2021-05-12T18:49:00Z")

</div>

I have a perfect foresight model that can be solved with the default option stack\_solve\_algo=0. Using robust\_lin\_solve yieds the same solution.

I would like to check if the solution found is in fact the correct one. Is there a guide for which solution algorithm should be used depending on the characteristics of the model?

---

<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:** [14 May 2021 06:59 UTC](https://forum.dynare.org/t/stack-solve-algo/18085/2 "2021-05-14T06:59:52Z")

</div>

A solution is a solution, no matter the underlying algorithm. What do mean with

> [@andre](#):
>
> if the solution found is in fact the correct one

If there are multiple solutions then different algorithms may converge to different solutions. But a numerical algorithm is not an equilibrium selection device. There is no way to tell which one performs better according to your metric that is obviously exogenous to the model to your implementing.

---

<div class="post-metadata">

**Author:** ![andre](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/6de8d8/32.png) [@andre](https://forum.dynare.org/u/andre)\
**Post date:** [14 May 2021 07:22 UTC](https://forum.dynare.org/t/stack-solve-algo/18085/3 "2021-05-14T07:22:32Z")

</div>

Let us say that there is a unique solution for a given set of parameters (around a large enough neighborhood).

It can be be the case that some of the algorithms available with the perfect foresight simulation in Dynare are more equipped to actually find the solution. Other algorithms might deviate from the solution. It might depend on the behavior of the model.

1. What are you saying is, if two algorithms converge, and there is a unique solution, then they will all converge to the same solution. The only difference is that some might take longer to reach the solution.

2. Moreover, if there is a unique solution, usually `stack_solve_algo=0,robust_lin_solve` will more likely find the solution.

Are these two statements right? Thank you

---

<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:** [14 May 2021 08:29 UTC](https://forum.dynare.org/t/stack-solve-algo/18085/4 "2021-05-14T08:29:18Z")

</div>

Yes, those two statements seem correct.
