Page 1 of 1

Expression or statement is incorrect--possibly unbalanced (,

PostPosted: Thu May 28, 2015 8:48 pm
by rwhitt01
Hello,

I have the following errors:

Error: File: gc_ov2.m Line: 280 Column: 89
Expression or statement is incorrect--possibly unbalanced (, {, or [.

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

I cannot figure out how to resolve this problem. I have reinstalled dynare but no luck.
Any help would be greatly appreciated.

Regards,
Richard

Matab version: R2014a
Dynare version: 4.4.3

Matlab output:


>> dynare gc_ov2

Configuring Dynare ...
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Local state space iteration (second order).
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.
[mex] Quasi Monte-Carlo sequence (Sobol).
[mex] Markov Switching SBVAR.

Starting Dynare (version 4.4.3).
Starting preprocessing of the model file ...
WARNING: gc_ov2.mod:11.12-15.5: Symbol rho declared twice.
Found 19 equation(s).
Evaluating expressions...done
Computing static model derivatives:
- order 1
Computing dynamic model derivatives:
- order 1
- order 2
Processing outputs ...done
Preprocessing completed.
Starting MATLAB/Octave computing.

Error: File: gc_ov2.m Line: 280 Column: 89
Expression or statement is incorrect--possibly unbalanced (, {, or [.

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

Re: Expression or statement is incorrect--possibly unbalance

PostPosted: Fri May 29, 2015 3:03 pm
by jpfeifer
Outside of the model block, you cannot have line breaks in equations like
Code: Select all
mc_a_foreign = -(((2 - alpha2 + (alpha1 + alpha2)*comOpenness)*(alpha2*(1 - comOpenness)
               + alpha1*comOpenness + alpha1*comOpenness*phi + alpha2*(1 - comOpenness)*zeta))
               / (1 - alpha2 + alpha2*(1 - comOpenness) + alpha1*comOpenness + (alpha1 + alpha2)*comOpenness)^2);

Matlab will interpret this as separate statements. The line that starts with the divide then leads to the crash.