Page 1 of 1

Matlab function with several inputs!

PostPosted: Mon Mar 07, 2016 3:35 pm
by Glm
Hi!

in order to solve the steady state for my model I have some non-linear equations. In this case 3 nonlinear equations. This implies that my Matlab function needs 3 input variables and will return 3 output variables once it's done. But the problem is that the steady state block won't except a vector, only integers.

In the example below I have

x2=[1;0.99;1.3];
x=fixa_micro(x2,delta,delta_e,a,beta,alpha,omega,PHI,mc);
n=x(1);
h=x(2);
k=x(3);

Then Dynare complains both about that "x2" is a vector and that x is a vector. So what should I do to solve this problem?


My steady state block in my mod-file looks like this

steady_state_model;
mu=0;
hiring=0;
mc=(beta*theta+eta-1)/eta;
x2=[1;0.99;1.3];
x=fixa_micro(x2,delta,delta_e,a,beta,alpha,omega,PHI,mc);
n=x(1);
h=x(2);
k=x(3);
e=(1-h)/delta_e;
y_firm=(e^a)*((alpha*k^((omega-1)/omega)+(1-alpha)*(h*n)^((omega-1)/omega))^(omega/(omega-1))-PHI);
w=(1-alpha)*(h^((omega-1)/omega))*mc*(((y_firm+(e^a)*PHI)/n)^(1/omega));
p_ss=(beta*alpha/(1-beta*(1-delta)))*mc*((y_firm+(e^a)*PHI)/k)^(1/omega);
p=p_ss;
p_firm=p_ss;
productivity=y_firm/n;
investment=delta*k;
mu_e=(a*beta/(1-beta*(1-delta_e)))*mc*(y_firm/e);
w_ss=w;
D=1;


\\\Glm

Re: Matlab function with several inputs!

PostPosted: Mon Mar 07, 2016 5:54 pm
by jpfeifer
Please provide me with the full file.

Re: Matlab function with several inputs!

PostPosted: Tue Mar 08, 2016 12:02 pm
by Glm
Hi!

I've attached the modfile as well as the Matlab files that solves the non-linear steady state variables.

\Glm

Re: Matlab function with several inputs!

PostPosted: Thu Mar 10, 2016 11:02 am
by jpfeifer
Please provide all files. I think the parametrar_funktion.m is missing.