Command overview

 

Introduction

 

Gekko is an open-source simulation system, designed for handling timeseries and simulating large-scale econometric or energy models (see www.t-t.dk/gekko). Below, in this document, the different Gekko commands are listed, grouped together by functionality. Instead of, or rather before, reading through these detailed documents, you may prefer reading some introductory guides:

 

Setup

Basic concepts

Guided tour

 

Databanks

In the standard setup, Gekko operates with two databanks; ‘Work’ (working bank) and ‘Base’ (baseline bank). There are the following commands related to databanks:

 

READ

Reads a databank file into 'Work' and 'Base' databanks

MULBK

Reads a databank file into 'Base' databank

OPEN

Reads a databank file into a specific databank name.

CLOSE

Closes read-only 'named' databanks opened (see OPEN)

WRITE

Writes a databank to .tsd(x) format (or .xls(x))

DIFPRT

Finds differences between Work and Base databanks.

FINDMISSINGDATA

This command finds variables with missing values.

TRIMVARS

Removes non-model variables from Work and Base databanks

UNSWAP

Unswaps databanks that may have been swapped in the F2 window.

 

 

Timeseries

 

Timeseries exist as objects in a databank. Frequency can be annual, quarterly or monthly, missing values are suppoted, and a timeseries can be of any length. Some of the commands compare data from the Base and Work databanks (or you may prefix a variable with ‘@’ to indicate the Base (baseline) version).

 

TIME

Sets global time

TIMEFILTER

Omits or averages certain periods in output

CREATE

Create a new timeseries

DELETE

Delete an existing timeseries

GENR

Transform a timeseries using mathematical expressions

UPD

Update a timeseries, setting e.g. growth rate etc.

UPDPRT

Prints variables in UPD format

COLLAPSE

Aggregate e.g. quarterly timeseries into annual timeseries etc.

LASPCHAIN()

Laspeyres chain function: see example under functions and LIST.

 

 

Lists etc.

 

Gekko can put timeseries in a list, in order to reuse the list for different purposes (or make the command file easier to read). In addition, memory variables like strings, dates and values can be used.

 

LIST        

Create and delete lists

DATE

Memory variable of date type

STRING

Memory variable of string type

VAL

Memory variable of value type

MEM

Shows a list of memory variables and their values

                 

 

Show data

 

Gekko can show data in several ways, including printing on the screen, graphs, or showing the data in an Excel sheet. In addition, there is a special table-like decomposition window (UDVALG). The DISP command also functions as an in-built equation browser.

 

PRT

Prints timeseries or expressions in different ways

MULPRT

Prints multipliers

PPLOT

Show a graph of timeseries (using gnuplot)

WPLOT

Show timeseries data in Excel

CPLOT

Like WPLOT, but copies cells to Windows clipboard

DISP

Prints more info, and starts equation browser

INFO

Displays precedents and their values (for endo variables)

UDVALG

Opens up the decomposition window

                                 

         

Model

 

A model can be loaded directly from a .frm file. After the model is loaded, a number of commands can be used:

 

MODEL

Load, parse and compile a model from file.

SIM

Simulates the model (also if there are goals/means)

RES

Performs single-equation static forecast of equations

EFTER

Runs inverted equations (add-factors etc.)

ENDO

Endogenize variables (means)

EXO        

Exogenize variables (goals)

UNFIX

Removes ENDO/EXO goals/means.

CHECKOFF

Skip convergence check for chosen variables (Gauss)

ITERSHOW

Show iterations in detail for chosen variable (Gauss)

SIGN

For signing models with signatures.

         

         

Command files

 

Larger problems can be run by means of command files (.cmd or .add files). There are the following commands related to such files:

 

RUN

Runs a .cmd file

PIPE

Direct output to an external file instead of screen

STAMP

Prints date and time

VERS

Prints Gekko version

PAUSE

Waiting for the user to click [Enter]

RETURN

Forces a return from a particular .cmd file

STOP

Returns from all (nested) .cmd files at once

EXIT

Closes the Gekko application

INI

Runs gekko.ini (or isstart.cmd) from working folder

TELL

Prints text on the screen

         

 

Cleanup

 

The principal cleanup-command is the following

 

CLEAR

Clearing workspace or databanks etc.

CLOSEALL

Same as CLEAR.

CLS        

Clears main window (short for 'clear screen')

 

 

Control flow

 

Gekko supports basic control flow like loops, conditional statements etc. At the moment the possibilities are quite limited, but will be augmented as the software matures.

 

FOR

For-loop over lists

IF

Conditional statement (IF-ELSE-END).

END

Ends loop or conditional statement

                 

 

Tables/menus

 

TABLE

Prints out a predefined table (xml)

MENU

Opens up a menu (html)

 

 

Miscellaneous

 

The following commands did not fall into the above categories, and so are gathered here:

 

HELP

Access the help system

OPTION

Sets different options

SYS        

Access the system shell if needed

 

 

From the menu items (‘Utilities’), you can also compare two databanks, check residuals, and compare variables in model/databank/varlist.