|
<< Click to Display Table of Contents >> Data handling statements overview |
![]() ![]()
|
Note: You may consult the general overview regarding all statements here: |
Introduction
Below, the different Gekko data related statements are listed, grouped together by functionality (regarding functions, see the section on these: 'Gekko functions'). The statements listed below are the core statements regarding data handling.
Databanks
At startup, Gekko operates with two databanks; 'Work' (first-position, working bank) and 'Ref' (reference bank). There are the following statements related to databanks:
Merges a databank file (typically non-gbk) into the first-position databank |
|
Writes the first-position databank to a non-gbk file |
|
Opens a databank file (typically gbk). May use OPEN<edit> or OPEN<ref>. |
|
Closes 'named' databanks (cf. OPEN) |
|
Retrieves timeseries from a web-based database |
|
Copies timeseries between banks (or inside the first-position databank) |
|
Renames timeseries. |
|
Uses wildcards to search for timeseries in databanks. |
|
Uses wildcards to count timeseries in databanks. |
|
Sets a databank editable |
|
Sets a databank non-editable |
Timeseries
Timeseries exist as objects in a databank. Frequency can be annual, quarterly, monthly, weekly, daily or undated.
Sets global time for timeseries operations. |
|
Delete an existing timeseries |
|
Transform a timeseries using mathematical expressions or data values |
|
Convert e.g. quarterly timeseries into annual timeseries etc. |
|
Convert e.g. annual timeseries into quarterly timeseries etc. |
|
Fills in missing values in a timeseries |
|
Splices two timeseries into one. |
|
Calculates an index series |
|
Removes observations in a timeseries outside the stated sample. |
|
Computes cross-correlations etc. |
|
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.
Create and delete lists |
|
Scalar variable of date type |
|
Scalar variable of string type |
|
Scalar variable of value type |
|
Define a matrix |
|
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 databank, for instance @gdp. Or else use colon to indicate a databank, for instance mybank:gdp.
Prints timeseries or expressions in different ways |
|
Prints info regarding timeseries, and starts equation browser |
|
Show a graph of timeseries (using gnuplot) |
|
Like PRT, but shows timeseries data in Excel |
|
Like PRT, but puts timeseries data on the Windows clipboard |
|
Prints text strings on the screen |
|
Show data-traces (timeseries) |
Gekko program files
Larger tasks can be run by means of program files (.gcm). There are the following statements related to such files:
Runs a .gcm program file. Use the EDIT statement to edit these files. |
|
Direct output to an external file instead of screen |
|
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.
Defines a user-defined function. |
|
Defines a user-defined procedure. |
|
Store functions/procedures inside a library .zip file for general use. |
Cleanup
The principal cleanup-statement is the following
Clears all databanks, lists, scalars, models, etc. and runs any gekko.ini files. |
|
Same as RESTART, but without running any gekko.ini files. |
|
Clearing databanks |
|
Closes all 'named' databanks, and clears Work and Ref. |
|
Clears main window (short for 'clear screen') |
|
Closes all PLOT or 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-loop over lists/strings, values or dates, parallel loops are possible. |
|
Ends loop (FOR), conditional statement (IF) or FUNCTION/PROCEDURE. |
|
Returns from the program file or function defintion. |
|
Stops execution completely. |
|
Stops execution completely, and terminates Gekko. |
|
Input data interactively |
|
Waiting for the user to click [Enter] |
|
Transfers execution to the corresponding TARGET |
|
Receives execution from the corresponding GOTO |
Tables/menus
Econometrics
Single-equation linear regression |
Python and R interfaces
Runs the decorated Python file, and returns matrices back to Gekko |
|
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:
Set Gekko mode to sim/data/mixed |
|
Access the help system |
|
Sets different options |
|
Indicate a particular Gekko version |
|
Edit a file via Notepad |
|
Edit a xml file via XML Notepad. |
|
Access the system shell if needed |
|
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.