Syntax error, unexpected EQUAL matlab

I am running a Dynare model and I have a lot of equations. For one of the equations, I receive error as follows:

Starting Dynare (version 4.4.3).
Starting preprocessing of the model file …
ERROR: code1a.mod: line 17, col 96: syntax error, unexpected EQUAL

Error using dynare (line 174)
DYNARE: preprocessing failed

I input all equations as given. How can I resolve this problem?

The error corresponds to:

The bracket in front of tau_l does never close.

Thanks a lot for your help :slight_smile: I have fixed the mistakes in my code. However I have a new error can I cannot understand. I have even used the unstable version of dynare but the problem still exists. It gives the following error:

Reference to non-existent field 'G_hat'. Error in read_variables (line 84) dyn_tmp_01 = s.(deblank(var_names_01(dyn_i_01,:))); Error in initialize_dataset (line 32) rawdata = read_variables(datafile,varobs,],xls.sheet,xls.range); Error in dynare_estimation_init (line 475) dataset_ = initialize_dataset(options_.datafile,options_.varobs,options_.first_obs,options_.nobs,transformation,options_.prefilter,xls); Error in dynare_estimation_1 (line 81) [dataset_,xparam1, hh, M_, options_, oo_, estim_params_,bayestopt_] = dynare_estimation_init(var_list_, dname, ], M_, options_, oo_, estim_params_, bayestopt_); Error in dynare_estimation (line 89) dynare_estimation_1(var_list,dname); Error in code1a (line 430) dynare_estimation(var_list_); Error in dynare (line 180) evalin('base',fname) ;

How can I resolve this issue? Kindly help me understand the error.
Thanks,
K
code1a.mod (6.76 KB)
code1a_steadystate.m (2.01 KB)

The datafile is missing.

PFA the data file.
data.txt (9 KB)

Okay so now I understand the problem that my variable names must be same in .mod and data file. Although I still think that G_hat must be solved from the equation rather than the G constructed before. G_hat needs to be calculated from this equation:

G_hat = - rho_g*Y_hat - gamma_g*B_hat(-1) + u_g;

Even if I renamed my data for government spending as G_hat; I am unable to understand why dynare is also asking for data on shocks. As per my understanding shouldn’t dynare calculate the shocks itself by solving the model?
Now I am getting the following error:

Reference to non-existent field 'uhat_b'. Error in read_variables (line 84) dyn_tmp_01 = s.(deblank(var_names_01(dyn_i_01,:))); Error in initialize_dataset (line 32) rawdata = read_variables(datafile,varobs,],xls.sheet,xls.range); Error in dynare_estimation_init (line 475) dataset_ = initialize_dataset(options_.datafile,options_.varobs,options_.first_obs,options_.nobs,transformation,options_.prefilter,xls); Error in dynare_estimation_1 (line 81) [dataset_,xparam1, hh, M_, options_, oo_, estim_params_,bayestopt_] = dynare_estimation_init(var_list_, dname, ], M_, options_, oo_, estim_params_, bayestopt_); Error in dynare_estimation (line 89) dynare_estimation_1(var_list,dname); Error in code1a (line 430) dynare_estimation(var_list_); Error in dynare (line 180) evalin('base',fname) ;
code1a.mod (6.76 KB)
data.txt (8.85 KB)
code1a_steadystate.m (2 KB)

Whatever variable you specify in the varobs command needs to be in the data file. You seem to be struggling with specifying a correct observation equation. See Pfeifer(2013): “A Guide to Specifying Observation Equations for the Estimation of DSGE Models”