Syntax error, unexpected EQUAL matlab

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.

Syntax error, unexpected EQUAL matlab

Postby khdjabbas » Mon Dec 28, 2015 1:36 pm

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?
khdjabbas
 
Posts: 5
Joined: Mon Dec 28, 2015 12:51 pm

Re: Syntax error, unexpected EQUAL matlab

Postby jpfeifer » Mon Dec 28, 2015 5:55 pm

The error corresponds to:
Code: Select all
B*B_hat + tau_k*alpha*Y*(that_k+Y_hat)+(tau_l*(1-alpha)

The bracket in front of tau_l does never close.
------------
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

Re: Syntax error, unexpected EQUAL matlab

Postby khdjabbas » Wed Dec 30, 2015 8:49 am

Thanks a lot for your help :) 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:

Code: Select all
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
Attachments
code1a.mod
(6.76 KiB) Downloaded 132 times
code1a_steadystate.m
(2.01 KiB) Downloaded 119 times
khdjabbas
 
Posts: 5
Joined: Mon Dec 28, 2015 12:51 pm

Re: Syntax error, unexpected EQUAL matlab

Postby jpfeifer » Wed Dec 30, 2015 10:47 am

The datafile is missing.
------------
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

Re: Syntax error, unexpected EQUAL matlab

Postby khdjabbas » Wed Dec 30, 2015 1:25 pm

PFA the data file.
Attachments
data.txt
(9 KiB) Downloaded 125 times
khdjabbas
 
Posts: 5
Joined: Mon Dec 28, 2015 12:51 pm

Re: Syntax error, unexpected EQUAL matlab

Postby khdjabbas » Thu Dec 31, 2015 9:48 am

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:
Code: Select all
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:

Code: Select all
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) ;
Attachments
code1a.mod
(6.76 KiB) Downloaded 106 times
data.txt
(8.85 KiB) Downloaded 114 times
code1a_steadystate.m
(2 KiB) Downloaded 101 times
Last edited by khdjabbas on Thu Dec 31, 2015 10:52 am, edited 1 time in total.
khdjabbas
 
Posts: 5
Joined: Mon Dec 28, 2015 12:51 pm

Re: Syntax error, unexpected EQUAL matlab

Postby jpfeifer » Thu Dec 31, 2015 10:33 am

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" at https://sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf.
------------
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 8 guests