# Estimation help

I’m attaching my code below. I am attempting to estimate the coefficient of auto correlation and the standard error of my shock process in a standard RBC model, just to try to get a hang of it. I keep getting the error "You did not declare endogenous variables after the estimation command.

I’m relatively new to dynare (this is my first time trying to do estimation) and I can’t find the bug in my code. Please let me know if there is anything glaringly obvious that I am doing wrong.
I thought I have declared my prior by the command estimated_params.
I have a feeling I haven’t declared enough options at in the “estimation” command, but I’m not sure.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Defining variables vs. parameters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

var y c k i y_n n z;
varexo e;

parameters beta delta theta rho psi chi sigma A;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Calibration
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
theta = 0.33;
A = 0.7959;
beta = 0.9976;
delta = 0.0075;
psi = 0.7;
sigma = 2;
chi = 35.5244;
rho = 0.95;
%sigma_eps = 0.006;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The Model
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

model;
(c^-sigma) = beta*(c(+1)^(-sigma))(1-delta+thetaexp(z(+1))A(k^(theta-1))(n(+1))^(1-theta));
chi
((n)^(1/psi))(c^sigma) = (1-theta)exp(z)A(k(-1)^theta)(n^(-theta));
c+i = y;
y = exp(z)A(k(-1)^theta)
(n)^(1-theta);
i = k-(1-delta)k(-1);
y_n = y/n;
z = rho
z(-1)+e;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Computation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
initval;
y = 1;
k = 33.33;
c = 0.75;
n = 0.25;
i = 0.25;
z = 0;
e = 0;
y_n = 4;
end;

shocks;
var e; stderr 0.006;
end;

estimated_params;
stderr e, inv_gamma_pdf, 0.007, inf;
rho, beta_pdf, 0.93, 0.006;
end;
%----------------------------------------------------------------
% Estimation: Tell it what data to Match
%----------------------------------------------------------------

varobs y k n;
estimation(datafile=input_file);

[quote=“wadd003”]"You did not declare endogenous variables after the estimation command.