Need help for finding problems of following codes.

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Need help for finding problems of following codes.

Postby kimjy39 » Sat Apr 09, 2011 1:32 pm

Hello, I hope to find the problems of following codes.

I try to put some asset pricing issues at model in 'example1.mod' that included in a initial dynare subfile.
With this intention, I input some codes as follows.
Thus, I add 'p', 'p = beta*(c/c(+1))*(p(+1)+y(+1))', and 'p = 1'
----------------------------------------------------------------------
var y, c, k, a, h, b, p;
varexo e, u;

parameters beta, rho, alpha, delta, theta, psi, tau;

alpha = 0.36;
rho = 0.95;
tau = 0.025;
beta = 0.99;
delta = 0.025;
psi = 0;
theta = 2.95;

phi = 0.1;

model;
c*theta*h^(1+psi)=(1-alpha)*y;
k = beta*(((exp(b)*c)/(exp(b(+1))*c(+1)))
*(exp(b(+1))*alpha*y(+1)+(1-delta)*k));
y = exp(a)*(k(-1)^alpha)*(h^(1-alpha));
k = exp(b)*(y-c)+(1-delta)*k(-1);
a = rho*a(-1)+tau*b(-1) + e;
b = tau*a(-1)+rho*b(-1) + u;
p = beta*(c/c(+1))*(p(+1)+y(+1));
end;

initval;
y = 1.08068253095672;
c = 0.80359242014163;
h = 0.29175631001732;
k = 11.08360443260358;
a = 0;
b = 0;
e = 0;
u = 0;
p = 1;

end;

shocks;
var e; stderr 0.009;
var u; stderr 0.009;
var e, u = phi*0.009*0.009;
end;

stoch_simul;
---------------------------------------------------------------------


But the result is,
----------------------------------------------------------------------
Configuring Dynare ...
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.

Starting Dynare (version 4.2.0).
Starting preprocessing of the model file ...
ERROR: example1.mod:48.5-37: To use an external function within the model block, you must first declare it via the external_function() statement.

??? Error using ==> dynare at 126
DYNARE: preprocessing failed
--------------------------------------------------------------------------



Unfortunately, I cannot understand what the message, 'To use an external~', means.

Would you please let me know what went wrong? Thank you.
kimjy39
 
Posts: 1
Joined: Sat Apr 09, 2011 12:52 pm

Re: Need help for finding problems of following codes.

Postby SébastienVillemot » Tue Apr 19, 2011 9:53 am

You need to declare your function as "external".

See the section about external functions in the reference manual: http://www.dynare.org/manual/re09.html
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 8 guests