Under the hood

<< Click to Display Table of Contents >>

Navigation:  Gekko User Manual > User manual introduction >

Under the hood

Previous pageReturn to chapter overviewNext page

Language, licence etc.

 

Gekko is written in C#.NET, which is among the most most popular programming languages today. Due to C# being object-oriented, development and redesign is flexible and efficient. It is planned to migrate from .NET Framework to .NET Core, which has better support for Mac or Linux, but for now, Mac or Linux users have to use virtualization software. Gekko is open-source (public domain, GNU GPL licence), implying that anybody can use the code for free, but any enhancements must be put into the public domain as well.

 

 

Parser, structure etc.

 

The databanks and variables in Gekko are object-oriented internally. There can be any number of databanks, with any number of time series for any given periods (including quarters, months and other frequencies), only constrained by working memory. All values and calculations are double-precision (64-bit) internally, and missing values are handled consistently. Timeseries variables can contain labels, source etc., and the underlying data structures are dynamically resizing arrays, in order to keep the system fast. Models and command-scripts (Gekko program files, .gcm) are parsed and dynamically translated into C# code by means of ANTLR, providing fast and reliable parsing.

 


 

Solvers

 

At the moment, four algorithms for solving a Gekko model are provided.:

 

First, standard Gauss-Seidel, where damping is supported via the formula codes. The program solves a large model with tens of thousands of equations quite quickly with the Gauss-Seidel algorithm.

In addition, a Newton method with line-search is implemented. This method does not depend upon the distinction between left- and right-hand side variables, and so can be used to solve difficult models or goals/means problems. The Newton solver uses a decomposition of the simultaneous block into a feedback set and the rest of the simultaneous block, reducing the dimension of the jacobian matrix considerably. The Newton solver can handle any number of means/goals simply by changing the set of endogenous variables.

The Fair-Taylor method ('fair') is used if the model contains leaded endogenous variables

Newton Fair-Taylor ('nfair') is used for harder problems, using the Newton method to accelerate the Fair-Taylor iterations.

 

Note that Gekko supports reading GAMS equations/models, for instance to analyze these via DECOMP.

 


 

Graphics, spreadsheets, gbk databanks

 

Graphics (PLOT) are done with gnuplot as the underlying engine, and another external module is used to read/write xlsx files (Excel). Gekko databanks (.gbk) are zipped protobuffers, so the format is open, well-documented and possible to interface. Protobuffers are also used internally for caching models, so that they load faster.

 

 


 

Name

 

Why was Gekko called Gekko? One of the first versions, from early 2008, was called Echo. The intention was to find a suitable acronym afterwards, where 'ec' would be 'economic' or 'econometric'. However, Echo sounded a bit too much like the Danish shoemaker Ecco. Thus, the similarly sounding Gekko was chosen, partly because a gecko is a nice animal, and intentionally choosing the Danish spelling to distinguish it from, among other things, the Gecko browser engine. The intention was still to find a suitable acronym, with the 'e' being 'economic' or 'econometric', but the search for a suitable acronym is still ongoing. Gekko supposedly means something like 'moonlight' in Japanese (which gives better associations than, for instance, Gordon Gekko, who did not inspire the name).