Notes and issues

<< Click to Display Table of Contents >>

Navigation:  Introduction >

Notes and issues

Previous pageReturn to chapter overviewNext page

Gekko 3.0 contains quite a lot of new features, and a cleaned up syntax. The syntax is hopefully more logical and consistent than version 2.0/2.2/2.4/2.5.x, and some of the most important changes regarding syntax are listed below.

 

At the end or this page, you will also find a list of issues with 3.0 and 3.1.x. These minor issues will be fixed in the form of patches to version 3.0 and 3.1.x.

 

Regarding lists of new statements, new built-in functions and new options, see the new features page, under Gekko 3.0. It is probably beneficial to read that section first, before reading the rest of the current page. See more on stability of the software below.

 

 

Stability

 

In general, Gekko 3.0 (release version) and 3.1.x (development version) are stable in the sense that smaller glitches may occur, while major bugs are not expected. There is currently a syntax freeeze, so the 3.1.x line of development versions will stay compatible with Gekko 3.0, and care is taken that the 3.1.x versions are as stable as the 3.0 version. Read more about the different Gekko versions here.

 

In general, it is advised to use the latest version in the 3.1.x development line rather than 3.0, and to migrate from Gekko 2.0/2.2/2.4/2.5.x if possible.

 

Besides the new components available in 3.1.x that are not present in 3.0, there is also a continued polishing going on in 3.1.x, which makes it a more pleasant experience than 3.0. Besides, the help system is much improved in 3.1.x relative to 3.0, and Gekko error messages will continually be made more understandable in 3.1.x (this is a project planned for the spring of 2021).

 

Gekko 3.0/3.1.x reads all databanks made by 2.x versions, and Gekko 2.5.x can read databanks from Gekko 3.0/3.1.x. So transferring databanks between Gekko 2.x and 3.x should not pose problems.

 

 

Beware

 

There is an automatic translator from Gekko 2.0 (or 2.2/2.4) to Gekko 3.0. See TRANSLATE, or more info here. The syntax changes compared to Gekko 2.0/2.2/2.4 programs are not too dramatic, the most important are the following:

 

Since series statements are calculated in a vector-like fashion in Gekko 3.0/3.1.x (in contrast to the Gekko 2.x versions), lags no longer automatically accumulate period-for-period, if the left-hand side variable is present with lags on the right-hand side (lagged dependent/endogenous variable). See more on the help page on dynamic statements. In Gekko versions >= 3.1.7, a statement like for instance = x[-1] + 1 will need to be decorated with an indication regarding whether it should accumulate (<dyn>) or not (<dyn = no>), cf. examples on the linked help page. Note that for absolute accumulations like <dyn> = x[-1] + 1, you may use <d>= 1, ^= 1 or dif(x) = 1 instead (and there are also variants regarding relative accumulations, see below). Note that setting <dyn> (or block series dyn = yes) unnecessarily entails a speed penalty and should therefore not be used unless needed.

Symbols on scalars and collections must appear on the left-hand side too, for instance val %= 100;, where val v = 100; is no longer legal. Note that assignment statements series, val, date, string, list, map, matrix may be omitted, so you can use %= 100; too.

In general, when defining a list, the elements are enclosed in parentheses, but the 'naked' form #= a, b, c; is allowed as short-hand for #= ('a', 'b', 'c');. For lists of simple numbers, naked lists can be used, too, for instance #= 1, 2, 3; or = 1, 2, 3;.

Beware that for %= #m; is no longer legal, you must indicate type: for string %= #m;.

The NAME statement is deprecated, and in many places {}-curlies must now be used where they could be omitted in Gekko 2.0. For instance you must use prt {#m}; or prt {%s}; to print the variables corresponding to the the list of strings #m or the string %s (without the {}-curlies, the list elements or the string itself would be printed).

Name compositions like a{i}b must now be a{%i}b: the %-symbol can no longer be omitted here (or anywhere else).

Name concatenation like a%i|b is no longer endorsed, but will still work. It is generally better to use a{%i}b, for readability and consistency.

#m[0] cannot be used to get the length of a list, use #m.length().

Using #m[%s] to check if the string %s is a member of the list of strings #m will be deprecated, and the expression %s in #m or #m.contains(%s) should be used instead.

Series operators like +, *, %, etc. are now +=, *=, %=, etc., so assignments always contain the = symbol.

List operators: &+ is changed to ||, &* is changed to &&, and &- is changed to -.

Scalars inside quoted strings should use {}-curlies, for instance %= 'car'; tell 'The {%s} is red';. Alternatively, you can use tell 'The ' + %+ is red';, which is harder to read. Beware that tell 'The %s is red'; will no longer in-substitute %s. Inside a quoted string, any expression can be used inside {}-curlies, as long as it evaluates to a string or value type.

IMPORT and EXPORT statements from Gekko 2.0 without time indication should be changed into IMPORT<all> and EXPORT<all>, respectively. In Gekko 3.0, IMPORT and EXPORT without time indication will use the global time period, potentially truncating the data.

The following functions have been changed (see details here): avgt(), sumt(), piece(), search(), strip(), trim(), difference(), hpfilter(), fromseries().

 

 

Issues list

 

The following is a list of statements etc. that are known to be defunct in in Gekko 3.0:

 

DECOMP. DECOMP works for expressions and equations. There are still issues regarding DECOMP of equations if the left-hand side is not equal to the right-hand side. Therefore: DECOMP of equations is ok if performed on simulated equations, but not on non-simulated equations.

TIMEFILTER only works for annual frequency.

User-defined procedures and functions have a problem with samples and composed series arguments, if these are later on lagged. For instance: function series plus(series x1, series x2); return x1 + x2[-20]; end; time 2001 2003; y1 = 3; y2 <1981 1983> = 2; print y1, y2, plus(y1, y2+0); This will print missings for the result of plus(y1, y2+0) whereas plus(y1, y2) will be fine. This is being looked into.