the neoclassical growth model--an error

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.

the neoclassical growth model--an error

Postby leelane » Fri Oct 05, 2012 8:13 am

when I ran the code ,there is something wrong like this:
Error using eval
Undefined function or variable 'c'.

Error in read_variables (line 52)
dyn_tmp_01 = eval(var_names_01(dyn_i_01,:));

Error in dynare_estimation_init (line 290)
rawdata = read_variables(options_.datafile,options_.varobs,[],options_.xls_sheet,options_.xls_range);

Error in dynare_estimation_1 (line 37)
[data,rawdata,xparam1] = dynare_estimation_init(var_list_);

Error in dynare_estimation (line 62)
dynare_estimation_1(var_list,varargin{:});

Error in GrowthEstimate (line 137)
dynare_estimation(var_list_);

Error in dynare (line 120)
evalin('base',fname) ;


and I don't know Undefined function or variable 'c'. So if anybody knows how it happened, please let me know. THanks a lot!
leelane
 
Posts: 14
Joined: Fri Oct 05, 2012 7:59 am

Re: the neoclassical growth model--an error

Postby leelane » Fri Oct 05, 2012 8:49 am

Code: Select all
var c k lab z;
varexo e;

parameters bet del alp rho the tau s;

bet     = 0.987;
the     = 0.357;
del     = 0.012;
alp     = 0.4;
tau     = 2;
rho     = 0.95;
s       = 0.007;

model;
    (c^the*(1-lab)^(1-the))^(1-tau)/c=bet*((c(+1)^the*(1-lab(+1))^(1-the))^(1-tau)/c(+1))*(1+alp*exp(z(+1))*k^(alp-1)*lab(+1)^(1-alp)-del);
    c=the/(1-the)*(1-alp)*exp(z)*k(-1)^alp*lab^(-alp)*(1-lab);
    k=exp(z)*k(-1)^alp*lab^(1-alp)-c+(1-del)*k(-1);
    z=rho*z(-1)+s*e;
end;

initval;
k   = 1;
c   = 1;
lab = 0.3;
z   = 0;
e   = 0;
end;

shocks;
var e;
stderr 1;
end;

estimated_params;
stderr e, inv_gamma_pdf, 2,inf;
rho, beta_pdf,0.93,0.02;
the, normal_pdf,0.3,0.05;
tau, normal_pdf,2.1,0.3;
end;

varobs c;

estimation(order=1,datafile=simudata,mh_replic=1000,mh_jscale=0.9,nodiagnostic) c;
leelane
 
Posts: 14
Joined: Fri Oct 05, 2012 7:59 am

Re: the neoclassical growth model--an error

Postby jpfeifer » Fri Oct 12, 2012 9:37 pm

Where is the data-file and does it contain a variable named c?
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 6 guests