Dear all,

I am new to Dynare and trying to run the external steady state.m file for my 2 period-OLG model. However, this undefined function error shows up. If I run the mod. file without external steady state.m file, it does work, also when I try to solve the steady state by fsolve, it finds numerical solutions for the steady state.

I checked some of the legacy posts, still I couldn’t solve the problem. The error message are follows.

Undefined function or variable ‘kstar’.

Error in paper2_210419_worked_steadystate (line 26)

tstar = (rrho*p_bar+ b_bar/(1-alppha-varrphi))*(1/(rrho*p_bar +
b_bar/(rrho*(1+gammaf

*e1f)*(1+phif+betta)+(1-rrho)

*chi_bar*(1+gammai

*e1i)*(1+phii+betta)/thetta -

rrho*(1+gammaf

*e1f)*(1+gammaf

*b_bar/((alppha*1/kstar^(1-alppha)*hstar^varrphi-deltta)*(1-tstar)*e1f)*(1-alppha-varrphi)+p_bar)

- (1-rrho)
*chi_bar*b_bar/(alppha*1/kstar^(1-alppha*hstar^varrphi)-deltta)*(1-chi_bar*tstar)*(1-alppha-varrphi)))) ;

Error in evaluate_steady_state_file (line 52)

[ys,check] = h_steadystate(ys_init, exo_ss);

Error in evaluate_steady_state (line 212)

[ys,params,info] = evaluate_steady_state_file(ys_init,exo_ss,M, options,steadystate_check_flag);

Error in steady_ (line 55)

[steady_state,params,info] = evaluate_steady_state(oo_.steady_state,M_,options_,oo_,~options_.steadystate.nocheck);

Error in steady (line 81)

[steady_state,M_.params,info] = steady_(M_,options_,oo_);

Error in paper2_210419_worked (line 310)

steady;

Error in dynare (line 235)

evalin(‘base’,fname) ;

Thank you very much in advance for your help.

paper2_210419_worked_steadystate.m (2.8 KB)

paper2_210419_worked.mod (9.1 KB)