What’s new?

  • The latest official stable release is Gekko 3.0. This marks a major upgrade, with syntax clarification, more flexible data objects (and storing of these in databanks), and generally a lot of new features. Users are advised to use the “stable” development versions 3.1.x instead of 3.0, cf. the versions overview page.
  • A stable version 2.4 is available, and it can read 3.0 or 3.1.x gbk databanks. In general, the work on the 2.x series is discontinued, and users are advised to migrate to Gekko 3.1.x.
  • You can track what is going on between releases by following the development page (and/or the changelog), or in even more detail at github, where every change in the source code is recorded.


New in Gekko 3.1.x and 3.0


New in Gekko 2.2

(This section is copied from the user manual)

Gekko 2.2 most notably adds a lot of new graphing capabilities (PLOT) to Gekko.

  • PLOT command completely overhauled, see demo graphs here. Graphs can be controlled in a lot of new ways, either as options in the PLOT command, or in a schema file (.gpt), or both. Histograms/bars/boxes are supported, too. There is a special handy option to separate boxes and lines vertically: PLOT<separate>, and many other possibilities.
  • OPEN<edit> should be used instead of OPEN<prim>, and LOCK/UNLOCK commands can lock/unlock already opened databanks. Opened databanks (OPEN without options) are now opened last in the list of databanks. Opened databanks are now protected (non-editable) per default.
  • OLS command improved, including linear restrictions on parameters.
  • INTERPOLATE and REBASE commands implemented.
  • XEDIT command to open up a dedicated and in-built xml editor (for graph and table schemas).
  • MATRIX command allows all kinds of indexers on left-hand side.
  • SHEET<import matrix> imports a matrix from an Excel sheet.
  • IMPORT accepts dates.
  • PIPE improvements.
  • Functions: random number functions, see rseed(), runif() and rnorm(). Functions pchy(), dify() and dlogy() to handle yearly differences. Functions movavg(), movsum() for moving averages/sums. Function chol() for Cholesky decomposition of matrices. See here.
  • Some new table options: ‘mdateformat’, ‘decimalseparator’, ‘thousandsseparator’ and ‘stamp’. See under OPTION, in the OPTION table … section. With these options, a number like 12345.67 can be printed as 12,345.67 or 12.345,67, and monthly dates can be formatted as for instance ‘Jan. 2020’ instead of ‘2020m1’. Menu files accept links to .gcm files.
  • The .gbk databank file format now uses a datafile called ‘’ internally (instead of ‘databank.bin’). The old name caused problems when sending databank files over email. To produce a databank file suitable for Gekko 2.0 or 1.8, see the note in the WRITE help file.
  • Options: see the end of the OPTION command regarding new options in Gekko 2.2.


New in Gekko 2.0

Gekko 2.0 is a major revision/redesign of Gekko, among other things regarding syntax. This means that older command files will not run unaltered in Gekko 2.0, but you may try the automatic translator that translates from Gekko 1.8 (or AREMOS). The most significant syntax changes are the following:

•VAL, DATE, NAME and STRING scalars are now referred to by means of the ‘%’ indicator/sigil, and not ‘#’. So after “VAL v = 2;”, you should refer to this scalar as %v. Lists are still referred to with ‘#’-indicator. The change makes the syntax much clearer in many cases, since ‘%’-variables can be thought of as scalars, whereas ‘#’-variables can be thought of as vectors/matrices.

•List items must be separated by commas (‘,’), not blanks. This too makes the syntax quite a bit clearer in many cases.

•All commands must end with a mandatory semicolon (‘;’). The use of ‘&’ to join lines is obsolete.

•Only the TIME command can change global time, whereas the individual commands can alter local time only (inside the <> option field). So for instance “SIM 2015 2020;” is not legal anymore, and must be “SIM <2015 2020>;”.

•There is a distinction between names and strings. Names are used to refer to databank objects, particularly timeseries, and are to be thought of as being without quotes (like the timeseries gdp for instance). Strings are sequences of characters (and may contain blanks and other special characters), and are to be thought of as being with quotes (like the string ‘Hello from Gekko.’). If %s is a string, using {%s} or the shorter {s} transforms the string to a name (without quotes). If %n is a name, you may use ‘%n’ or $n to transform the name into a string.

•Scalar names can be composed/recursive, when using the %(…) pattern. For instance “VAL i = 2; VAL v = %(v%i);”, where the last VAL is equivalent to VAL v = %v2;”.

•All indexing is done with []-brackets, for instance gdp[2010], gdp[-1], #mylist[%i], #covar[%i, %j]. Parentheses are for function calls exclusively (lags can be done with gdp.1 = gdp[-1], however). For some time onwards, (-1), (-2), etc will also be accepted as lags in models, instead of the officieal use of [-1], [-2], etc.

•Ranges use ‘..’, for instance #mylist[%i..%i+2], #mylist[pxa..pxqz], or for matrices #m[1..3, 2..4]. You can also use dot-ranges in FOR, for instance “FOR i = 1..10;”.

•Extension names have been changed. Command-files (RUN) were formerly ‘.cmd’ (or ‘.gek’), and are now ‘.gcm’. Gekko-databank files (READ/OPEN) were formerly ‘.tsdx’, and are now ‘.gbk’. Table defintion files (TABLE) were formerly ‘.tab’, and are now ‘.gtb’. In the future, model ‘.frm’ files will be renamed, too, but for now the extension is kept.

•Comments are either ‘//’ for single-line comments, or ‘/*’ followed by ‘*/’ for multi-line comments. You can no longer use ‘()’ or SKIP to out-comment.

•Some command name changes. CLEAR and CLOSEALL are now RESET or RESTART, CPLOT is CLIP, (N)DIFPRT is COMPARE, EFTER is SIM<after>, GENR and UPD are SERIES, MULBK is READ<ref> or CLONE, PPLOT is PLOT, STAMP is ‘TELLcurrentDateTime()’, TRIMVARS is DELETE<nonmodel>, UDVALG is DECOMP, UPDPRT is EXPORT, VERS is ‘TELLgekkoVersion()’, and WPLOT is SHEET.

•Databank reading and writing is separated into gbk formats (READ and WRITE) versus non-tsd formats (IMPORT andEXPORT). READ and IMPORT can now use TO keyword, for instance “READ file1 TO bank1;” or “READ file1 TO *;”. This enhancement of READ and IMPORT means that users mostly doing simulations can avoid the more complicated OPENcommand altogether.

•DUMON and DUMOFF are removed. Instead of “DUMON d2000;” use “SERIES d2000 = 1;”, and instead of “DUMOFF d2000;” use “SERIES d2000 = 0;”.

•The FLAT command is removed. If you need to set all model variables constant, please use “SERIES #all % 0;” instead. If you do not have a model loaded and still need to flatten variables, you may alternatively use “SERIES [*] % 0;” instead.

•The ZERO command is removed. If you need to set all model variables to zero, please use “SERIES #all = 0;” instead. If you do not have a model loaded and still need to zero variables, you may alternatively use “SERIES [*] = 0;” instead.

•TIMESPAN and VPRT cannot be used (use TIMEFILTER instead).

•You can only use gekko.ini and not isstart.cmd as name for an auto-start file.

In addition to these changes, there are quite a few new commands and other functionality in Gekko 2.0, relative to Gekko 1.8. To sum it up, the most important changes in functionality are the following:

•The new MODE command switches between Gekko modes (‘sim’, ‘data’ or ‘mixed’).

•Solving with leaded variables has been improved a lot, using a new ‘Newton-Fair-Taylor’ algorithm (‘nfair’).

•Databanks: OPEN<prim> functionality introduced, for data revision purposes. Gekko 2.0 starts up with with two databanks, ‘Work’ and ‘Ref’ (primary and reference databank), where the reference databank (known as ‘Base’ in Gekko 1.8) is often used for comparisons, for instance MULPRT, PLOT, DECOMP, etc. You may use READ<prim>, IMPORT<prim>, READ<sec> or IMPORT<sec> to load data into these two databanks individually. Databanks can be searchable, if OPTION databank search = yes (or MODE is set to ‘data’ or ‘mixed’), but please note that the reference databank is never searchable.

•Databanks: COPY, RENAME, INDEX, COUNT, etc. are introduced.

•Quite a lot of timeseries capabilities, like SMOOTH, SPLICE, TRUNCATE, ANALYZE.

•The SERIES command merges the former GENR and UPD commands. You can now use ‘operators’ to change values, for instance “SERIES <p> y = 15;” to augment y with 15% per period (you can still use the old operators, for instance “SERIES y % 15;”). The operators <d>, <p>, <m>, <q> and <mp> are supported, cf. also the PRT command.

•A new DOC command to handle meta information on timeseries: label, source and stamp (last change). Gekko now handles these attributes when writing and reading from .gbk or .tsd files, and the source attribute will now show the last SERIESexpression that changed the timeseries.

•List capabilities are improved, for instance union, intersection, difference, []-indexing, etc. See LIST.

•Matrices are introduced, see MATRIX and all the matrix functions, including packing and unpacking to timeseries.

•A lot of string functions.

•User defined functions with FUNCTION command

•Parallel FOR loops, and GOTO/TARGET. An iif() function for intra-period logical operations on timeseries.

•Econometrics: OLS command for linear regression, else you may use R for econometrics (see R_RUN for an OLS example via R).

•Interface to R: data can be easily interchanged back and forth, see the R_FILE, R_EXPORT and R_RUN commads.

•Online databanks: see the DOWNLOAD command for an interface to a particular online databank (‘Statistikbanken’).

•Seasonal adjustment, see the X12A command.

•The logic regarding SIM with ENDO/EXO goals has been changed a bit, enforcing the use of SIM<fix> to attain goals.

•New EDIT command that opens up a file in Notepad.

•New ACCEPT command for interactive input.

•When using WRITE, Gekko will store information in the .gbk file regarding the model used (model name, simulation period, signature, etc.). This information can be displayed while READ-ing the bank.

•The PLOT command can forward gnuplot code for improved graph layout.

•Non-annual frequencies (quarters and months) have been tested quite thoroughly in Gekko 2.0.

To support these features, the .gcm file parser and code emitter has been re-written from the ground up. Among other things this means that new features, for instance new commands, or extra options in existing commands, are much easier to implement.


New in Gekko 1.8

Most important changes/improvements in Gekko 1.8, relative to Gekko 1.6:

•Reading Excel files (READ <xlsx>). Transposed reading is possible too (also for .csv files).

•Reading/converting .prn files (WRITE).

•Listfiles: you may use LIST mylist = #(listfile myfile). The external listfile has an item on each line.

•PPLOT can be used with <a>, <ap> or <ad> operators in order to plot values from both the Work and Base databanks at the same time. Output can be saved in .png or .svg format, too. Point indicators in the graphs may be omitted (OPTION graph lines points).

•HP-filter function for time series, see functions.

•Possibility of fixed parameters in a model file (using for instance #c1, defined elsewhere in the model file).

•A new frequency ‘undated’ (U) is introduced. This frequency works much like annual, and may for instance start in period 0, followed by 1, 2, 3, etc.

•Zoom level can be set for font sizes in the Gekko main window (see OPTION interface zoom).

•Tables: quite a few tweaks for tables. You may use one-period columns, and put grey vertical borders between designated periods. See also the options under OPTION table html.


New in Gekko 1.6

Most important changes/improvements in Gekko 1.6, relative to Gekko 1.4:

•Help now files in standard .chm format (separate window), i.e. searchable, printable, etc.

•Suggestions will pop up while writing OPTION commands (see OPTION interface suggestions), for easier navigation of the option ‘tree’.

•Much faster simulation (SIM), both Gauss and Newton.

•Faster model loading (MODEL statement), because known models are cached on the hard disk. A known model loads about eight times faster than before.

•Model signatures (hash codes) are introduced. See SIGN command.

•Model blocks are supported (can be used when doing ‘Check residuals’).

•Forward-looking models (endogenous with leads) can be solved with Fair-Taylor algorithm (many options to control this).

•New .tsdx format version 1.1. This version is binary, and about three times faster to load than version 1.0. Default databank format is now .tsdx instead of .tsd.

•FOR loop improvements. You can now loop over DATEs and VALs, too.

•IF statement improved to allow OR, AND and NOT, and with comparisons (‘<‘, ‘==’, etc.). You can compare VAL, DATEs and STRINGs.

•STRING, DATE and VAL statements accept expressions on the right-hand side. You may also refer to individual timeseries observations (with ‘variable[period]’).

•Recording of user commands. See menu ‘Edit’ –> ‘Command history…’.

•Tables (defined in xml) and menus (defined in html). Tables can be printed as text or html (the latter is default now).

•PRT and MULPRT operator simplifications and improvements, adding multiple operators and/or element-specific operators. Formatting codes available too. Transposed printing possible.

•Easy cell copy-pasting via clipboard to spreadsheet: CPLOT and new ‘Copy’-button (that copies last PRT/MULPRT or table to the clipboard).

•’Named’ databanks possible (OPEN command). Any number of in-memory databanks may be opened and referenced to with colon (‘:’). A new F2 databank window makes it possible to swap databanks with drag&drop. For safety, after swapping, Gekko enters swap-mode with some limitations on available commands (see UNSWAP).

•’Run status’ window, to keep track of currently executing command file(s).

•Bulk closing or updating PPLOT and/or UDVALG windows. See ‘Window’ menu.

•Transformation of timeseries from higher frequencies to lower frequencies (COLLAPSE)

•Decomposition window (UDVALG) accepts expressions, and is improved.

•TIMEFILTER command for easy hiding of periods when reporting (PRT, tables etc.). Also replaces VPRT.

•Goals/means syntax simplification (UNFIX command).

•Command to trim superfluous variables from a databank (TRIMVARS)

•PIPE can pipe to html and combine with html tables.

•Laspeyres chain index function: LASPCHAIN(). Accepts negative quantities too (subtracted).

•Reading and writing .csv files is possible for easier interface to Excel etc.

•Default databank format is changed from .tsd to .tsdx.

•Equation reordering is switched off as default (OPTION solve gauss reorder).

•Name change of ‘isstart.cmd’ to ‘gekko.ini’.

•DISP can search in labels.

•TELL command.

•MEM command to show scalar variables.