 # Steady state file- problem with fsolve

Dear Prof Pfeifer,

I have tried to incorporate the DMP framework to asset pricing model. Solving for the steady state is not possible analytically, hence i wrote a steady state.m file.

I have attached both the m file and mod file. Fsolve does not seem to solve my highly non linear equation to get theta_t. Please could you explain how to give the initial value under fsolve for the attached m file?

Many Thanks
Ammu

What do you mean? You are already providing an initial value. In

```[theta_t,fval,exitflag]=fsolve(@(theta_t)(exp(m+dn)*((1-s)+(((exp(k_h1t)*(1+exp(iota*theta_t))^(1/iota))+exp(k_h2t))^(-1))*(((1-eta)*(1-epsitlon)*(1-alphat)*exp(alphat*(log((delta-1+exp(-m))/(((epsitlon*nu)^(epsitlon/(1-epsitlon)))*(1-epsitlon)*alphat*exp((a+log((1+s*(1+exp(-iota*theta_t))^(-1/iota))))*(1-alphat))))/(alphat-1)-log((1+s*(1+exp(-iota*theta_t))^(-1/iota)))))*exp((1-alphat)*a)*((epsitlon*nu)^(epsitlon/(1-epsitlon))))-eta*(exp(k_h1t+theta_t)+ (exp(k_h2t)/((1+exp(-iota*theta_t))^(1/iota))))-(1-eta)*exp(bt))))-1,log(2),options); ```
it’s the

Hello Prof Pfeifer,

Sorry if my question was not clear.

I tried giving some random initial values in the above code to see if I would be able to solve for a steady state value for theta_t.

However, I was unable to solve for theta_t. So I am asking if there is a methodology where I can give an initial value instead of log(2) to help me solve the equation?

Many Thanks
Ammu

What you can always do is check for the

``exitflag``

and add an if-clause that tries to solve the equation with a different starting value whenever the exitflag>0 (which should be the error codes.)