Statements overview

<< Click to Display Table of Contents >>

Navigation:  Gekko User Manual > Gekko statements >

Statements overview

Previous pageReturn to chapter overviewNext page

Note: You may consult the specialized overviews regarding data handling and modeling:

Data handling statements overview

Modeling statements overview.

 

Introduction

 

Below, all Gekko statements are listed, grouped together by functionality (regarding functions, see the section on these: 'Gekko functions').

 

Databanks

 

At startup, Gekko operates with two databanks; 'Work' (first-position, working bank) and 'Ref' (reference, baseline bank). There are the following statements related to databanks:

 

READ

Reads a databank file (typically gbk) into the first-position and reference databanks.

WRITE

Writes the first-position databank to a gbk file

IMPORT

Merges a databank file (typically non-gbk) into the first-position databank

EXPORT

Writes the first-position databank to a non-gbk file

OPEN

Opens a databank file (typically gbk). May use OPEN<edit> or OPEN<ref>.

CLOSE

Closes 'named' databanks (cf. OPEN)

CLONE

Makes the reference databank an exact copy of the first-position databank.

DOWNLOAD

Retrieves timeseries from a web-based database

COPY

Copies timeseries between banks (or inside the first-position databank)

RENAME

Renames timeseries.

INDEX

Uses wildcards to search for timeseries in databanks.

COUNT

Uses wildcards to count timeseries in databanks.

COMPARE

Finds differences between the first-position and reference databanks.

FINDMISSINGDATA

This statement finds timeseries with missing values.

HDG

Inserts a heading (description) into a gbk databank

UNLOCK

Sets a databank editable

LOCK

Sets a databank non-editable

 

 

Timeseries

 

Timeseries exist as objects in a databank. Frequency can be annual, quarterly, monthly, weekly, daily or undated.

 

TIME

Sets global time for timeseries operations.

TIMEFILTER

Omits or averages certain periods in output

CREATE

Create a new timeseries

DELETE

Delete an existing timeseries

SERIES

Transform a timeseries using mathematical expressions or data values

COLLAPSE

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

INTERPOLATE

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

SMOOTH

Fills in missing values in a timeseries

SPLICE

Splices two timeseries into one.

REBASE

Calculates an index series

TRUNCATE

Removes observations in a timeseries outside the stated sample.

ANALYZE

Computes cross-correlations etc.

DOC

Change meta information (label, source and date stamp)

 

 

Lists, scalars, matrices etc.

 

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

 

LIST        

Create and delete lists

DATE

Scalar variable of date type

STRING

Scalar variable of string type

VAL

Scalar variable of value type

MATRIX

Define a matrix

MEM

Shows a list of scalar 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 (DECOMP). The DISP statement also functions as an in-built equation browser. You may prefix a variable with '@' to indicate the reference ('Ref') databank, for instance @gdp. Or else use colon to indicate a databank, for instance mybank:gdp.

 

PRT

Prints timeseries or expressions in different ways

MULPRT

Prints multipliers: differences between the first-position and reference databanks.

DISP

Prints info regarding timeseries, and starts equation browser

PLOT

Show a graph of timeseries (using gnuplot)

SHEET

Like PRT, but shows timeseries data in Excel

CLIP

Like PRT, but puts timeseries data on the Windows clipboard

DECOMP

Decompose an equation

FIND

Find a variable in equations

FLOW

Show a flowgraph corresponding to a DECOMP statement

TELL

Prints text strings on the screen

TRACE

Show data-traces (timeseries)

                                 

         

Model

 

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

 

MODEL

Load, parse and compile a model from file.

SIM

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

ENDO

Endogenize variables (means)

EXO        

Exogenize variables (goals)

UNFIX

Removes ENDO/EXO goals/means.

PREDICT

Single-equation prediction

CHECKOFF

Skip convergence check for chosen variables (Gauss)

ITERSHOW

Show iterations in detail for chosen variable (Gauss)

SIGN

For signing models with signatures.

         

         

Gekko program files

 

Larger tasks can be run by means of program files (.gcm). There are the following statements related to such files:

 

RUN

Runs a .gcm program file. Use the EDIT statement to edit these files.

PIPE

Direct output to an external file instead of screen

INI

Runs gekko.ini if located in the program and/or working folder

 

 

Functions/procedures

 

You may use user-defined functions or procedures to avoid repetitive tasks and encapsulate functionality.

 

FUNCTION

Defines a user-defined function.

PROCEDURE

Defines a user-defined procedure.

LIBRARY

Store functions/procedures inside a library .zip file for general use.

         

 

Cleanup

 

The principal cleanup-statement is the following

 

RESTART

Clears all databanks, lists, scalars, models, etc. and runs any gekko.ini files.

RESET

Same as RESTART, but without running any gekko.ini files.

CLEAR

Clearing databanks

CLOSEALL

Closes all 'named' databanks, and clears Work and Ref.

CLS        

Clears main window (short for 'clear screen')

CUT

Closes all PLOT and DECOMP windows

 

 

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/strings, values or dates, parallel loops are possible.

IF

Conditional statement (IF-ELSEIF-ELSE-END).

END

Ends loop (FOR), conditional statement (IF) or FUNCTION/PROCEDURE.

RETURN

Returns from the program file or function defintion.

STOP

Stops execution completely.

EXIT

Stops execution completely, and terminates Gekko.

ACCEPT

Input data interactively

PAUSE

Waiting for the user to click [Enter]

GOTO

Transfers execution to the corresponding TARGET

TARGET

Receives execution from the corresponding GOTO

                 

 

Tables/menus

 

TABLE

Prints out a predefined table (xml)

MENU

Opens up a menu (html)

 

 

Econometrics

 

OLS

Single-equation linear regression

 

 

Python and R interfaces

 

PYTHON_RUN

Runs the decorated Python file, and returns matrices back to Gekko

R_RUN

Runs the decorated R file, and returns matrices back to Gekko

 

 

Miscellaneous

 

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

 

MODE

Set Gekko mode to sim/data/mixed

HELP

Access the help system

OPTION

Sets different options

GEKKO

Indicate a particular Gekko version

EDIT

Edit a file via Notepad

XEDIT

Edit a xml file via XML Notepad.

SYS        

Access the system shell if needed

TRANSLATE

Translates syntax from Gekko 1.8 or AREMOS

 

 

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