# Problems in calculating steady state

**URL:** <https://forum.dynare.org/t/problems-in-calculating-steady-state/11775>\
**Category:** Steady state\
**Created:** [2 May 2018 20:51 UTC](https://forum.dynare.org/t/problems-in-calculating-steady-state/11775 "2018-05-02T20:51:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![fabianowar](https://forum.dynare.org/letter_avatar_proxy/v4/letter/f/f05b48/32.png) [@fabianowar](https://forum.dynare.org/u/fabianowar)\
**Post date:** [2 May 2018 20:51 UTC](https://forum.dynare.org/t/problems-in-calculating-steady-state/11775/1 "2018-05-02T20:51:57Z")

</div>

The expression to the left of the equals sign is not a valid target for an assignment.  
In my code a calculate I o steady state, but my function is compost and matlab not recognize. Below is the code:

function x= q\_k,q\_h,x\_ss,r\_d;r\_pol;r\_biw;r\_bih;r\_be,lam\_p,lam\_i,lam\_e,s\_ih,s\_iw,s\_e,c\_p,c\_i,c\_e,h\_p,h\_i,h\_e,b\_ih,b\_iw,b\_e,d,w\_p,w\_i,y\_e,l\_p,l\_i,premium,h,y,luc\_y,k\_b,y\_exp;  
x(1): lam\_p;  
x(2): lam\_i;  
x(3): lam\_e;  
x(4): s\_ih;  
x(5): s\_iw;  
x(6): s\_e;  
x(7): c\_p;  
x(8): c\_i;  
x(9): c\_e;  
x(10): h\_p;  
x(11): h\_i;  
x(12): h\_e;  
x(13): b\_ih;  
x(14): b\_iw;  
x(15): b\_e;  
x(16): d;  
x(17): w\_p;  
x(18): w\_i;  
x(19): y\_e;  
x(20): y;  
x(21): k;  
x(22): l\_p;  
x(23): l\_i;  
x(24): Q;  
x(25): er;  
x(26): B\_star;  
x(27): premium;  
x(28): k\_b;  
x(29): y\_exp;  
lam\_p = 1/c\_p;  
lam\_i = 1/c\_i;  
lam\_e = 1/c\_e;  
s\_ih = (1/(1 + r\_bih) - betai/piss)_lam\_i;  
s\_iw = (1/(1 + r\_biw) - betai/piss)lam\_i;  
s\_e = (1/(1 + r\_be) - betae/piss)lam\_e;  
c\_p = w\_pl\_p + ((1 + r\_d)/piss - 1)d + luc\_y - deltahh\_p;  
c\_i = w\_il\_i - ((1 + r\_bih)/piss - 1)b\_ih - ((1 + r\_biw)/piss - 1)b\_iw -deltahh\_i;  
c\_e = y\_e/x\_ss - w\_pl\_p - w\_i_l\_i - er_pQ_Q - ((1 + r\_be)/piss - 1)_b\_e-deltak_k-deltah_h\_e;  
h\_p = jh/((1 - (1 - deltah)betap)lam\_p);  
h\_i = jh/((1 - (1 - deltah)betai)lam\_i - (1 - deltah)s\_ihmihpiss);  
h\_e = jh/((1 - (1 - deltah)betae)lam\_e - (1 - deltah)s\_emepiss);  
b\_ih = (1/(1 + r\_bih))mihqh(1 - deltah)h\_ipiss;  
b\_iw = (1/(1 + r\_biw))miww\_il\_ipiss;  
b\_e = (1/(1 + r\_be))me( q\_h(1 - deltah)h\_episs + q\_k_(1 - deltak)_k_piss);  
d = b\_ih + b\_iw + b\_e - er_B\_star - k\_b;  
w\_p = (eps\_l/(eps\_l - 1))_(l\_p^phi)/lam\_p;  
w\_i = (eps\_l/(eps\_l - 1))_(l\_i^phi)/(lam\_i + s\_iw_miw);  
y\_e = (k^alphak)_(l\_p^(mu_alphal))_(l\_i^((1 - mu)alphal))(Q^(1-alphal - alphak));  
l\_p = (mu_alphal/x\_ss)_(y\_e/w\_p);  
l\_i = ((1 - mu)alphal/x\_ss)(y\_e/w\_i);  
Q = ((1 - alphak - alphal)/x\_ss)_(y\_e/(er_pQ));  
lam\_e_q\_k = s\_e_me_q\_k_piss_(1 - deltak) + betae_lam\_e_(alphak_y\_e/(x\_ss_k)+q\_k\*(1 - deltak));  
premium = exp(-zeta_er_B\_star/k\_b);  
premium\*(piss/piss\_star)_(1 - zeta_er_B\_star/k\_b)=(1 + r\_pol)/(1 + R\_star);  
h = h\_p + h\_i + h\_e;  
y = c\_p + c\_i + c\_e + deltah_h + deltak_k + y\_exp;  
y\_exp - er_pQ_Q - (1 + (1 + R\_star)premium/piss\_star-1/piss\_star)erB\_star=0;  
luc\_y = (1 - 1/x\_ss)y;  
k\_b = (1/(piss - 1 + deltakb))(r\_bihb\_ih + r\_biw_b\_iw + r\_be\*b\_e);

---

<div class="post-metadata">

**Author:** ![fabianowar](https://forum.dynare.org/letter_avatar_proxy/v4/letter/f/f05b48/32.png) [@fabianowar](https://forum.dynare.org/u/fabianowar)\
**Post date:** [3 May 2018 12:44 UTC](https://forum.dynare.org/t/problems-in-calculating-steady-state/11775/2 "2018-05-03T12:44:49Z")

</div>

[steadystate.mat.m](https://forum.dynare.org/uploads/default/original/2X/1/13828321d05ec09cd519a1f2653e251e6ac59aed.m) (3.8 KB)[steadystate.mat.m](https://forum.dynare.org/uploads/default/original/2X/1/13828321d05ec09cd519a1f2653e251e6ac59aed.m) (3.8 KB)

---

<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:** [3 May 2018 13:46 UTC](https://forum.dynare.org/t/problems-in-calculating-steady-state/11775/3 "2018-05-03T13:46:38Z")

</div>

Please upload the correct file. The one above cannot be correct.

> [@fabianowar](#):
>
> x(29): y\_exp;

is not proper Matlab code.

---

<div class="post-metadata">

**Author:** ![fabianowar](https://forum.dynare.org/letter_avatar_proxy/v4/letter/f/f05b48/32.png) [@fabianowar](https://forum.dynare.org/u/fabianowar)\
**Post date:** [3 May 2018 13:51 UTC](https://forum.dynare.org/t/problems-in-calculating-steady-state/11775/4 "2018-05-03T13:51:43Z")

</div>

[silva2015.m](https://forum.dynare.org/uploads/default/original/2X/f/f891acb6f091c4ba03de18dc3c51676d9b798486.m) (8.5 KB)  
This is correct file. I’m sorry the wrong file.

---

<div class="post-metadata">

**Author:** ![fabianowar](https://forum.dynare.org/letter_avatar_proxy/v4/letter/f/f05b48/32.png) [@fabianowar](https://forum.dynare.org/u/fabianowar)\
**Post date:** [4 May 2018 14:28 UTC](https://forum.dynare.org/t/problems-in-calculating-steady-state/11775/5 "2018-05-04T14:28:49Z")

</div>

Please professor help me, because i not understand the that happened.

---

<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:** [5 May 2018 08:49 UTC](https://forum.dynare.org/t/problems-in-calculating-steady-state/11775/6 "2018-05-05T08:49:32Z")

</div>

What are you doing? When splitting the file, I can run it:  
[Silva\_main.m](https://forum.dynare.org/uploads/default/original/2X/c/c70f6bfd3ac2526e34ef3226fbf72bcf658eb304.m) (3.7 KB)  
[tese2014\_rotemberg5.m](https://forum.dynare.org/uploads/default/original/2X/5/52901d131f0ad0ae28ab23449745e27fea4ccfd9.m) (4.8 KB)

---

<div class="post-metadata">

**Author:** ![fabianowar](https://forum.dynare.org/letter_avatar_proxy/v4/letter/f/f05b48/32.png) [@fabianowar](https://forum.dynare.org/u/fabianowar)\
**Post date:** [5 May 2018 21:17 UTC](https://forum.dynare.org/t/problems-in-calculating-steady-state/11775/7 "2018-05-05T21:17:52Z")

</div>

> [@jpfeifer](#):
>
> What are you doing? When splitting the file, I can run it:

Thank you professor was putting the file together, this way, it was not running properly.
