OPTION

<< Click to Display Table of Contents >>

Navigation:  Gekko User Manual > Gekko statements >

OPTION

Previous pageReturn to chapter overviewNext page

Three types of options

Gekko operates with three types of options: global options, block-options and local options. Global options are stated with the OPTION command and apply until changed. Block options are stated with the BLOCK command and apply for a block of Gekko statements. Local options are stated inside the <> local option field and apply to that single statement only. See more here.

 

The OPTION statement sets various global option values, in a hierarcical tree of possibilities. "OPTION ?" gives an overview regarding different options and their current values. Below, the different options are described (with their default values indicated).

 

Note that Gekko provides suggestions (a small popup-window) for the OPTION statement (to switch suggestions off, use option interface suggestions = none;). The popup-window looks like the following, where you can select and click [Enter].

 

clip0085

 


 

Syntax

 

option type = value;

 

type

One or more space-delimited options

value

Boolean (e.g.: yes|no)

Integer (e.g.: 200)

Floating point number (e.g.: 0.45)

String (eg.: 'newton')

Name (eg.: newton)

Filename (eg.: t:\forecast\b.gbk)

 

For strings/names/filenames, it is optional whether to use quotes (string like 'q') or not (name like q). For instance, these all set quarterly frequency:

 

%= 'q';

option freq = q;

option freq = {%f};

option freq = 'q';

option freq = %f;

 

Note: the = may be omitted in most cases: option freq q; and option freq = q; are equivalent. For Gekko 4.0, the = will probably become mandatory, so keeping the ='s in Gekko program file is probably wise.

 

Below the full list of options are provided, with their default values. You may set temporary options via the BLOCK structure.

 

 


 

Options

 

option collapse method = total; [total|avg|first|last]

This option sets the default collapse method. Applies to the COLLAPSE statement and the collapse() function.

 

option collapse missing d = strict; [strict|flex]

When collapsing from series of d (daily) frequency, Gekko will per default be strict regarding missing values (missing days will entail missing data in the lower-frequency timeseries). Set this to flex if you prefer flexibility (skipping the missing days). Applies to the COLLAPSE statement and the collapse() function.

 

option copy respect = no; [yes|no]

Regarding the COPY statement, if no period is given, the global period is used (default: no). [New in Gekko 3.1.15].

 

option databank create auto = yes; [yes|no]

If yes, timeseries will be auto-created. For instance, y1 = 100; will be possible without create y1;, even if y1 does not exist in the first-position databank.  Setting option databank create auto = yes; and option databank search = yes; can be practical in data revision programs. See also the MODE statement.

 

option databank file cache = nongbk; [all|nongbk|none]

Whether or not a databank file cache is used for faster databank (re)reading. The none option corresponds to Gekko < 3.1.14. Because a Gekko .gbk file is essentially a cache file, the speed gains of using a file cache for .gbk files are limited, and therefore the default option is nongbk. You may use option all to cache .gbk files, too (will save a bit of unzipping time). The databank file cache applices to all kinds of databank files that can be read with READ or IMPORT.

 

If yes, when reading (READ/IMPORT) or opening (OPEN) a databank, the file will first be copied into a temporary file on the user's hard

 

option databank file copylocal = yes;

If yes, when reading (READ/IMPORT) or opening (OPEN) a databank, the file will first be copied into a temporary file on the user's hard drive. This will often speed up reading/opening files on network drives.

 

option databank file gbk compress = yes;

option databank file gbk internal = 'databank.data';

Some options regarding the .gbk format, applying only to writing or closing databanks (WRITE/CLOSE). Without compression there are some speed gains while writing and reading, but in most cases the speed gains do not outweigh having to deal with much larger databank files. The internal name for the data file inside the zipped .gbk file is normally databank.data, but can be changed here. Gekko 3.1.x always writes gbk databanks in the 1.2 version of that format (but it can read both 1.0, 1.1 and 1.2 gbk databanks, that is, from all older Gekko's).

 

option databank search = no;

If yes, variables will be searched for in all open databanks except the Reference databank (cf. the F2 window). Setting option databank create auto = yes; and option databank search = yes; can be practical in data revision programs.  See also the MODE statement, and the databank searching page. Note that the Local or Global databanks are always searchable, independent on MODE etc.

 

NOTE: When running the same series statements again and again iteratively (for instance, iterating over rows and columns in an input-output table until convergence), you may consider switching off data tracing with option databank trace = no;. For such solver-like scenarios, data tracing may slow down the calculations needlessly.

 

option databank trace = yes; [yes|no]

If yes (default) timeseries changes (including array-series) are "recorded" in the form of traces. Traces are shown with DISP (with Gekko version >= 3.1.16) and are stored in Gekko databanks (.gbk), too. If, for instance, you activate tracing with option databank trace = yes; and issue the following statements: x1 = 1/100; and x2 = x1 + 1;, a DISP of x1 will show the trace x1 = 1/100, whereas a DISP of x2 will show the trace x2 = x1 + 1; and also link to the trace viewer which will also show you the sub-trace x1 = 1/100 (even x1 is subsequently deleted). Databank-wise, any traces are lost if a databank containing traces is READ with a Gekko version < 3.1.16, followed by a WRITE (the same goes for OPEN<edit> and CLOSE). Databank tracing is experimental, and therefore the TRACE2 command has a '2' suffix that will be removed when the functionality is mature enough. [New in 3.1.16].

 


 

option decomp maxlag = 10;

option decomp maxlead = 10;

When decomposing, effects via lags are restricted within these values (larger values = slower decomp). This does not apply to GAMS scalar models.

 

option decomp plot zoom = 100;

A DECOMP plot may appear too large or too small on some screens and resolutions. This is being investigated, but until then, you can use the zoom option to change the size of DECOMP plots (default = 100%).

 


 

option fit ols rekur dfmin = 10;

Minimum degrees of freedom when doing recursive estimations for OLS.

 


 

option folder = yes; [yes|no]

If yes, Gekko will look for files in predefined folders (is switched on per default).

 

option folder bank = [empty];

option folder bank1 = [empty];

option folder bank2 = [empty];

While reading, importing or opening databanks (READ/IMPORT/OPEN), Gekko will first look for databanks in the working folder, and then in the bank, bank1 and bank2 folders (in that order). If the folder contains blanks, single quotes should be used (for instance option folder bank = 'c:\my banks'). Relative paths may be used: option folder bank = \databanks. In that case, Gekko will look for a sub-folder databanks in the working folder. If bank is set, databanks are written to that folder (WRITE).

 

option folder command = [empty];

option folder command1 = [empty];

option folder command2 = [empty];

While looking for Gekko program files (see RUN),  Gekko will first look for .gcm files in the working folder, and then in the command, command1, command2 folders (in that order).

 

option folder help = [empty];

Folder where Gekko looks for the help system (gekko.chm file). Normally this file is located where Gekko is installed (and comes bundled with the installer files).

 

option folder menu = [empty];

Folder where Gekko looks for menu files (.html files).

 

option folder model = [empty];

Folder where Gekko looks for model files (.frm files).

 

option folder pipe = [empty];

Folder where Gekko pipes out text output files (see the PIPE statement). If no folder is indicated, piped files will end up in the working folder.

 

option folder table = [empty];

option folder table1 = [empty];

option folder table2 = [empty];

Folders where Gekko looks for table files (.gtb files). Gekko will first look in table, then table1, and last table2 folders.

 

option folder working = [empty];

This changes the Gekko working folder. The option survives RESET or RESTART statements. (For advanced users: note that you can also use the parameter '-folder' with the gekko.exe file, for instance: gekko.exe -folder:c:\mygekkofiles).

 


 

option freq = a; [a|q|m|w|d|u]

Sets frequency of timeseries to a (annual), q (quarterly), m (monthly), w (weekly), d (daily) or u (undated). Note that week numbering follows the ISO 8601 standard.

 


 

option gams exe folder = [empty];

This option starts out empty, and if so, GAMS will try to auto-detect the location of the executable for GAMS (gams.exe). The auto-detection seems to be pretty good at locating a 32-bit GAMS for a 32-bit Gekko, and a 64-bit GAMS for a 64-bit Gekko. Instead of this auto-detection, you may try to set the folder name manually, for instance option gams exe folder = 'c:\GAMS\win32\24.1';. Note that only the path is indicated, excluding the file name. Please use quotes if the folder contains dots (.).

 

option gams fast = yes;

Default GAMS read is using a fast reader (so-called low-level API). If this poses problems, try the more robust normal API by setting option gams fast = no;.

 

option gams time detect auto = no;

option gams time freq = a; [a, q, m, d, u]

option gams time offset = 0;

option gams time prefix = '';

option gams time set = t;

These options describe how the time dimension is obtained from the GAMS variables and parameters. The default values correspond to the time being the GAMS set name t, with natural annual values like 2020, 2021, 2022, etc. If the time values are instead, for instance, t0, t1, t2, you may use option gams time prefix = t;
option gams time offset = 2020;. In that case, t0 will be understood as 2020, t1 as 2021, etc. If a variable/parameter does not use a strict set (for instance with the name t in this case, cf. option gams time set) or this set name is not recognized, Gekko may in that case represent these as for instance x['2020'], x['2021'], etc., where each of these sub-arrayseries is a timeless series (this representation is pretty much useless). To remedy this problem, either decorate the time dimension in the gdx file with for instance the set/domain name 't', or use option gams time detect auto = yes. With this option, for any variable/parameter where a time dimension is not recognized as a domain name, Gekko will "taste" the individual data lines of the variable/parameter, and try to identify a dimension that seems like a time dimension. For annual time values, if all values of a particular dimension are integers in the range 1500 <= t <= 3000, Gekko will presume that this is a time dimension.

 

option gams trim = 0;

For GDX files, with this setting set to n, only variables/parameters with >= n elements (in the GAMS sense) are imported. For instance, setting option gams trim = 1, variables/parameters with 0 elements are ignored (this can be set in order to clean up, or for comparison purposes (cf. COMPARE)). When counting GAMS elements, elements that have value 0 or "eps" are not counted.

 


 

Note: 'global' options can only be set in a gekko.ini file next to the gekko.exe file.

 

option global dependency tracking = none; [none|simple]

When set to simple, Gekko tracks the use of external files (for instance program files, read/written databanks etc.). A list of such files is shown at the end of a Gekko session (you may alternatively use the Gekko menu 'Options' --> 'Program dependency tracking').

 


 

option interface alias = no; [yes|no]

When this option is set, Gekko will look for at list with the name #alias to perform alias substitution of names. For instance, global:#alias = (('a', 'x'), ('b', 'y[z]')); will mean that prt a, b; is interpreted as prt x, y[z];. So the #alias list is a list of lists, where the inner lists contain the source name and the destination name. Among other things, #alias can be convenient as a bridge between the naming conventions of two different models. You can switch on and off the use of alias with this option, but if you need to use another #alias list, you have to first perform a RESET/RESTART.

 

option interface clipboard decimalseparator = period; [period|comma]

The option is used in three places: (1) in the CLIP statement, (2) regarding the 'Copy'-button on the user interface (copying cells from the last print to the clipboard), and (3) regarding copy-pasting cells from the DECOMP window. The setting is not relevant for SHEET which does not use the clipboard.

 

option interface csv decimalseparator = period; [period|comma]

Used with IMPORT<csv> and EXPORT<csv>, where the databank is a csv (comma separated) file.

 

option interface csv delimiter = semicolon; [semicolon|comma|tab]

Used with IMPORT<csv> and EXPORT<csv>. The field delimiter is ; per default, but can be set to , or [tab-symbol] instead. This symbol delimits the columns of data. Regarding EXPORT<csv>, combining option interface csv delimiter = comma; with option interface csv decimalseparator = comma; will issue a warning. [New in 3.0.5].

 

option interface csv ignoremissing = no;

When yes, all missing values in an exported (EXPORT<csv>) csv file are represented as blank cells. The default is no, which makes for instance subsequent summing of Excel cells less prone to missings-bugs. [New in 3.1.16].

 

option interface csv ndec = 100;

Number of decimals when writing levels in a .csv file. A value > 20 is interpreted as "full machine precision". [New in 3.1.2].

 

option interface debug = dialog; [dialog|none]

Choose between dialog or none. If dialog, the user may rerun a file on syntax errors, or skip lines on runtime errors.

 

option interface edit style = gekko; [gekko | gekko2 | rstudio | rstudio2]

The default style is gekko. With gekko2, an [Enter] will execute the line AND move the cursor to the next line. Therefore, with gekko2, multiple lines can be executed with [Enter] [Enter] ... [Enter] instead of [Enter] [downarrow] [Enter] [downarrow] ... [Enter]. With gekko and gekko2, [CTRL+Enter] issues a new line without executing anything (like a newline in Notepad). The rstudio style emulates RStudio, where [Enter] works like a newline in Notepad, and [Ctrl+Enter] executes the line. With rstudio style, an issued statement moves the cursor to the next line (similar to gekko2). With rstudio2 style, [Ctrl+Enter] does not move to the next line (similar to gekko).

 

option interface errors = normal; [old|normal]

Sets how error messages are shown. Choose old for error messages corresponding to Gekko version < 3.1.14. The normal (that is: new) error messages handle program structure a lot better.

 

option interface excel ignoremissing = no;

When yes, all missing values in an exported (EXPORT<xlsx>) Excel file are represented as blank cells. The default is no, which makes for instance subsequent summing of Excel cells less prone to missings-bugs. [New in 3.1.16].

 

option interface excel language = danish; [danish|english]

If set to danish, CLIP, SHEET and the 'Copy' button will use the Excel code "ikke.tilgængelig()" instead of "na()" to indicate missing values. Also, if set to danish, EXPORT<csv> will use '#N/A' for missing values (instead of '#I/T'), provided that option interface csv ignoremissing = no.

 

option interface excel modernlook = yes; [yes|no]

Turns on modern looking blue colors in SHEET.

 

option interface help copylocal = yes;

If this option is active, Gekko will copy the file gekko.chm into a local folder on the user's hard disk, before it is opened (for instance with F1, or the HELP statement). In Windows 7 and 8, problems will arise when trying to open up a .chm files from a network drive, so keeping the option active should eliminate such problems.

 

option interface mode = data; [sim|data|mixed]

Sets some interface messages/warnings etc. regarding different modes (see the MODE statement). This option is not intended for direct use: please use the MODE statement that changes the mode explicitly.

 

option interface mute = no; [yes|no]

When this option is set to yes, all screen output (or pipe file output) is suppressed. If errors occur, this option is automatically set to no. Alternatively, PIPE can also be used to suppress screen output and direct it to a file instead. The option is is primarily set in program files/procedures/functions to avoid voluminous screen output blocking and slowing the user interface. [New in 3.0.6].

 

option interface prn decimalseparator = period; [period|comma]

Used with IMPORT<prn> and EXPORT<prn>, where the databank is a prn file. [New in 3.1.16].

 

option interface prn delimiter = blank; [blank|semicolon|comma|tab]

Used with IMPORT<prn> and EXPORT<prn>. The field delimiter is blank per default, but can be changed. Regarding EXPORT<prn>, combining option interface prn delimiter = comma; with option interface prn decimalseparator = comma; will issue a warning. [New in 3.1.16].

 

option interface prn ndec = 100;

Number of decimals when writing levels in a .prn file. A value > 20 is interpreted as "full machine precision". [New in 3.1.16].

 

option interface remote = no; [yes|no]

option interface remote file = '';

If the first option is set to 'yes', Gekko will look for a file named remote.gcm (the default file name) in the current working folder. If that file is changed (Gekko looks at Windows time stamps), the whole file is run (corresponding to RUN remote.gcm;). This makes remote controlling of a Gekko instance possible from, for instance, an external text editor. For instance, typing Alt+Enter or something similar in the editor might be set up so that a remote.gcm file containing the contents of the text line (or block of lines) is created. See also a Gekko-specific add-in for the Sublime text editor here.

 

option interface sound = no; [yes|no]

option interface sound type = bowl; [bowl|ding|notify|ring]

option interface sound wait = 60;

If active, Gekko will play a sound when a program file finishes (or has an error). The sound type can be bowl, ding, notify, ring. The last option is the minimum duration of the job (in seconds), before for Gekko plays a sound.

 

option interface suggestions = option; [none|option]

If set to option, small popup with suggestions will appear when entering options.

 

option interface table operators = yes;

If yes, html tables will include radio buttons to select operators by point-and-click, for instance percentage growth, or multiplier differences. Note: 'operators' was called 'printcodes' in Gekko 2.4 and earlier.

 

option interface zoom = 100;

The zoom level (default = 100%) regarding font sizes in the user interface (the three tabs in the main window). May be increased on high-res monitors, or for educational purposes (projector).

 


 

option interpolate method = repeat; [repeat|prorate]

This option sets the default interpolate method. Applies to the INTERPOLATE statement and the interpolate() function.

 


 

option library cache = yes; [yes|no]

Whether or not a library cache is used.

 


 

option menu startfile = menu.html;

The filename for the html menu file shown in the 'Menu' tab (see MENU).

 


 

option model cache = yes; [yes|no]

Whether or not a model file cache is used for faster model (re)loading.

 

option model cache max = 20;

The maximum number of compiled models kept in RAM (cached), during a Gekko session. Reduce the number if you for instance are doing a lot of ENDO/EXO simulations and run into memory issues.

 

option model gams dep current = no;  [yes|no]

When reading a GAMS model with MODEL<gms>, Gekko will try to identify the dependent variable in each GAMS equation. If option model gams dep method = lhs (default), Gekko will try to find the first variable on the left-hand side that is not inside a []-bracket or a $-condition. WIth current = no, Gekko will identify the variable as dependent, even if it contains a lag or lead. With current = yes, Gekko will only look for variables that have no lags and no leads. See also the model <dep = ...> local option under MODEL. [New in 3.0.2].

 

option model gams dep method = lhs;  [lhs|eqname]

When reading a GAMS model with MODEL<gms>, Gekko will try to identify the dependent variable in each GAMS equation. With option lhs, Gekko will try to find the first variable on the left-hand side that is not inside a []-bracket or a $-condition. With option eqname, Gekko uses the equation name instead, for instance the equationname e_pc_tot is understood as identifying the variable pc as dependent variable. In both these cases, such identification can be overruled with a list identifying these relationships, cf. the model <dep = ...> local option under MODEL. [New in 3.0.3].

 

option model infofile = yes; [yes|no]

If no, Gekko will not produce a modelname__info.zip file after a MODEL statement (with default model type).

 

option model type = default; [default|gams]

If type = gams, Gekko will handle ENDO, EXO, UNFIX and DISP differently to ease the interaction with GAMS. When you load a Gekko model with MODEL, Gekko automatically sets option model type = default;, and when you load a GAMS model with MODEL<gms>, Gekko automatically sets option model type = gams;.

 


 

option plot decimalseparator = period; [comma|period]

The type of decimal separator used for tic labels.

 

option plot elements max = 200;

Limits the number of curves in a graph, so that PLOT does not crash or stall when accidently feeding with too many elements. See PLOT<nomax>.

 

option plot lines points = yes; [yes|no]

Whether or not the PLOT graph has individual points indicated with markers. This can also be controlled for each varible via <type = lines> vs. <type=linespoints>.

 

option plot using = [empty];

With this option, a global .gpt PLOT template file can be set, for instance option plot using = m:\common\gekko.gpt;. Subsequent PLOT statements will then use that template (unless the PLOT statement itself has a using argument).

 

option plot xlabels annual = at; [at|between]

option plot xlabels nonannual = between; [at|between]

Whether or not the data points are at x-tics, or between them. For quarterly and monthly data, the latter is often the most logical.

 

option plot xlabels digits = 4; [2|4]

Number of digits in the year (at the x-labels). The option only applies to labels between tics, not labels at tics (see the preceeding options). With two digits, we get 15, 16, 17, instead of 2015, 2016, 2017.

 


 

option print collapse = none; [avg|total|none]

If this option is set to avg or total, Gekko will print averages or totals for timeseries of frequencies quarterly or monthly. Cf. also the COLLAPSE statement. Only applies to option print freq = pretty;.

 

option print disp maxlines = 3;

The number of lines of data shown per default in the DISP statement. You may choose -1 for infinite, 0 means that no data are shown.

 

option print elements max = 400;

Limits the number of elements in a print, so that PRT does not crash or stall when accidently feeding with too many elements. See PRT<nomax>.

 

option print fields ndec = 4;

option print fields nwidth = 13;

option print fields pdec = 2;

option print fields pwidth = 8;

These options set the default decimals and width of number fields when printing with PRT or MULPRT. The first two sets decimals and width for for non-percent fields, and the two last for percent fields. The ndec and nwidth settings also affect printing of matrices.

 

option print freq = pretty; [pretty|simple]

If this option is set to pretty, timeseries of frequencies are printed with separation, blank lines, etc., for better readability. If the option is set to simple, the dates are shown without such separation.

 

option print mulprt abs = yes; [yes|no]

option print mulprt gdif = no; [yes|no]

option print mulprt lev = no; [yes|no]

option print mulprt pch = yes; [yes|no]

option print mulprt v = no; [yes|no]

These options set the default way of printing with the MULPRT statement. Per default, abs and pch are chosen, so MULPRT shows absolute multiplier difference (abs), and relative difference (pch). These can be overridden via the option fields in the MULPRT statement.

 

option print prt abs = yes; [yes|no]

option print prt dif = no; [yes|no]

option print prt gdif = no; [yes|no]

option print prt pch = yes; [yes|no]

These options set the default way of printing with the PRT statement. Per default, abs and pch are chosen, so PRT shows the absolute level (abs), and the growth rate (pch). These can be overridden via the option fields in the PRT statement.

 

option print split = no; [yes|no]

If set, the variables or expressions delimited by comma are shown separately, cf. also the local option PRT<split>. With the global option set, prt x, y; is shown as if it had been prt x; prt y;. This may be practical for comparisons of data with similar columns, for instance prt x[#i], @x[#i];. In that case, you may prefer to use for instance the <missing = m> option, so that all columns (#i) are shown (and are hence aligned), regardless of whether the sub-series exist or not.

 

option print width = 100;

Line width (number of characters) when printing to screen

 


 

option python exe folder = [empty]; [New in 3.1.8]

This option starts out empty, and if so, Gekko will try to auto-detect the location of the executable folder for Python (python.exe). If this auto-detection fails, you may try to set the folder name manually, for instance option python exe folder = 'c:\Users\Thomas\AppData\Local\Programs\Python\Python36_64\python.exe';. If this name does not end with .exe, .bat or .cmd, Gekko will append python.exe or \python.exe. So in the above example, option python exe folder = 'c:\Users\Thomas\AppData\Local\Programs\Python\Python36_64'; would have been equivalent. If you use a .bat or .cmd file, it could contain a line like "c:\Users\Thomas\AppData\Local\Programs\Python\Python36_64\python.exe" %%%3 to preserve the arguments.

 


 

option r exe folder = [empty];

This option starts out empty, and if so, Gekko will try to auto-detect the location of the executable folder for R (R.exe, or to be precise Rscript.exe). If this auto-detection fails, you may try to set the folder name manually, for instance option r exe folder = 'c:\Program Files\R\R-3.0.0\bin\R.exe';. Note the single quotes because of the blank in 'Program Files'. If this name does not end with .exe, .bat or .cmd, Gekko will append R.exe or \R.exe. So in the above example, option r exe folder = 'c:\Program Files\R\R-3.0.0\bin'; would have been equivalent. If you use a .bat or .cmd file, it could contain a line like "c:\Program Files\R\R-3.0.0\bin\R.exe" %%%3 to preserve the arguments.

 


 

option series array calc missing = error; [error|m|zero]

With option error (default), a missing #i element in x in an expression like for instance sum(#i, x[#i]) will halt with an error. With option m, Gekko will not halt, but will use missing values instead of x[#i] -- so the sum will return a missing value. With zero, zeroes are used instead of missing elements in x[#i], so the sum is calculated as if the missing elements were skipped.

 

option series array print missing = error; [error|m|zero|skip]

With option error (default), a missing #i element in x in prt x[#i]; will halt with an error. With option m, missing values will be printed (typically as 'N' instead of 'M' to indicate that it is a non-existing sub-series). With zero, zeroes are printed instead, and with skip, the missing #i's are skipped (not shown). See also the local option <missing = ...> for PRT. As mentioned, with option missing = m, the raw prt x[#i]; will show missing #i elements as 'N' because they are non-existing, whereas an expression like prt x[#i] + 1; will show them as 'M', since they are now a result of a mathematical expression.

 

option series data missing = m; [m|zero]

With option m (default), missing data/observations in a normal series or array-series are propagated normally, so that an expression containing a missing value will always result in a missing value. With option zero, a missing value in an observation will be treated as if the value was 0. There are other options that deal with the question of what to do if a normal series or array-subseries does not exist at all, so this option solely affects the time domain: what to do if an observation inside a series is missing. In some cases, for instance when importing data from GAMS, such a missing observation could sensibly be interpreted as the value 0. See more on this, including examples, on this page, and cf. also the <missing = ignore> local option for SERIES and PRT/PLOT/SHEET. [New in 3.0.3].

 

option series dyn = no; [yes|no]

With this option, lagged endogenous variables like in the statement x = x[-1] + 1; accumulate over time, because the statement is run 'dynamically', one period at a time consecutively. The option will only be active, if the right-hand side of the statement is of series type. Because the use of this option entails a speed penalty, the option can only be activated via BLOCK; ... ; end; (see BLOCK).

 

option series dyn check = yes; [yes|no]

With this option, statements like x = x[-1] + 1; are checked regarding the existence of lagged endogenous variables on the right-hand side, and is such variables are present, the statement must be decorated with a <dyn>, <dyn = no>, or be inside of a suitable BLOCK that sets the same option (block series dyn = yes|no). If this is not the case, versions 3.1.7 and higher of Gekko will fail with an error. This is to guard against simply forgetting to put a <dyn> or block series dyn = yes on an accumulating statement. [New in 3.1.7].

 

option series failsafe = no; [yes|no]

When this option is set, Gekko will abort with an error message, when a series statement like for instance = x; or y[2020] = %v; tries to insert an observation containing a missing value into the left-hand series. The option can be practical for debugging Gekko program files (.gcm), if the source of a missing value is hard to track. The option is only intended for debugging purposes. See also option solve failsafe. [New in 3.0.2].

 

option series normal calc missing = error; [error|m|zero]

With option error (default), a missing series x in a calculation will will halt with an error. With option m, missing values will be used instead of x, and with zero, zeroes are used instead of the missing x.

 

option series normal print missing = error; [error|m|zero|skip]

With option error (default), a missing series x in prt x; will halt with an error. With option m, missing values will be printed (typically as 'N' instead of 'M' to indicate that it is a non-existing series). With zero, zeroes are printed instead, and with skip the missing x series is skipped (not shown). See also the local option <missing = ...> for PRT. As mentioned, with option missing = m, the raw prt x; will show N's because the series is non-existing, whereas an expression like prt x + 1; will show the missings as 'M', since they are now a result of a mathematical expression.

 


 

option sheet collapse = none; [avg|total|none]

If this option is set to avg or total, Gekko will show averages or totals for timeseries of frequencies quarterly or monthly. Cf. also the COLLAPSE statement. Only applies to option sheet freq = pretty;.

 

option sheet engine = internal; [internal|excel]

For reading and writing Excel spreadsheet files, Gekko will normally use an internal engine to do this. This engine is independent upon Excel being installed on the user's pc. The internal engine only supports .xlsx files, not the older .xls files. If you need to access the older .xls files, you may set the option to excel which reads and writes both the old and new format. Beware however, that the excel option demands Excel being installed on the pc. It is also a bit slow and unstable, and may leave Excel processes behind, eating up memory.

 

option sheet freq = simple; [pretty|simple]

If this option is set to pretty, timeseries of frequencies are printed with separation, blank lines, etc., for better readability. If the option is set to simple, the dates are shown without such separation.

 

option sheet mulprt abs = yes; [yes|no]

option sheet mulprt gdif = no; [yes|no]

option sheet mulprt lev = no; [yes|no]

option sheet mulprt pch = no; [yes|no]

option sheet mulprt v = no; [yes|no]

[NOT USED YET]. These options set the default way of printing with the SHEET<mul> (not implemented yet) statement. Per default, only 'abs' is chosen, so SHEET<mul> shows absolute multiplier difference ('abs'). These can be overridden via the option fields in the SHEET statement.

 

option sheet prt abs = yes; [yes|no]

option sheet prt dif = no; [yes|no]

option sheet prt gdif = no; [yes|no]

option sheet prt pch = no; [yes|no]

These options set the default way of printing with the SHEET statement. Per default, abs is chosen, so SHEET shows the absolute level (abs). These can be overridden via the option fields in the SHEET statement.

 

option sheet cols = no; [yes|no]

option sheet rows = yes; [yes|no]

Per defaut, the SHEET statement prints timeseries row-wise, that is, with variable names in the first column, and time periods in the first row. These options may change the orientation, or you can use SHEET<rows> or SHEET<cols>.

 


 

option smooth method = linear; [linear|geometric|repeat|spline|overlay]

This option sets the default smoothing method. Applies to the SMOOTH statement and the smooth() function.

 


 

option solve data create auto = yes; [yes|no]

If yes, when a databank is read by means of the general READ statement (that is, excluding READ<first> or READ<ref>, but including READ<merge>), all model variables not present in the file are auto-created (and filled with missing values). See also the MODE statement.

 

option solve data ignoremissing = no; [yes|no]

If yes, if a variable has a missing value when Gekko tries to simulate (SIM), the number zero will be used instead. Warning: this may get the model to simulate, but the result may be incorrect!

 

option solve data init = yes; [yes|no]

If yes, when simulating lagged values are used as starting values for endogenous variables (this is default and typically the most robust). If no, the current period values are used as starting values for endogenous variables.

 

option solve data init growth = yes; [yes|no]

option solve data init growth min = -0.02;

option solve data init growth max = 0.06;

If set yes, Gekko will look at the historical growth rate of endogenous variables, in order to come up with good initial values. With the sub-options min and max, you may indicate a range. Per default, the range is set to -2% up to 6%, meaning that only historical growth rates within that range will be used to initialize endogenous variables. The 'growth' option typically speeds up SIM convergence, provided resonable min/max limits are used.

 

option solve failsafe = no; [yes|no]

If yes, the Gauss algorithm will stop at the exact time when any equation produces a missing value. The option slows the simulations down a bit (which is why it is not set per default). When the option is on, variables from the above-mentioned problematic equation will be printed out on screen automatically (using DISP<info>). See also option solve newton robust. and option series failsafe.

 

option solve forward dump = no; [yes|no]

If yes, information regarding the Fair-Taylor iterations is kept. With one lead-variable, you can see the iterations by means of printing the variables ftabs1_1, ftabs1_2, ftabs1_3, etc., where the last number is the FT-iteration (try plot {'ftabs1_*'};). If Newton-Fair-Taylor ('nfair') is used, there will also be matrices #ft_1, #ft_2, etc., containing the Jacobi interaction between leaded variables.

 

option solve forward fair conv = conv1; [conv1|conv2]

Set Fair-Taylor convergence type to conv1 (default) or conv2. This corresponds to the criteria used in the option solve gauss conv ... options.

 

option solve forward fair conv1 abs = 0.001;

option solve forward fair conv1 rel = 0.001;

Relative criterion for the (default) conv1-type convergence check, and absolute criterion for the (default) conv1-type convergence check. Note that the criteria are less strict than the corresponding Gauss criteria.

 

option solve forward fair conv2 tabs = 1.0;

option solve forward fair conv2 trel = 0.001;

Relative criterion for the PCIM-like conv2-type convergence check, and absolute criterion for the PCIM-like conv2-type convergence check. Note that the criteria are less strict than the corresponding Gauss criteria.

 

option solve forward fair damp = 0.0;

Damping used regarding leaded endogenous variables in the Fair-Taylor algorithm. The larger the factor is, the harder the damping. Setting the factor to 0.0 means no damping at all, whereas setting it to 1.0 means the equations cannot progress.

 

option solve forward fair itermax = 200;

option solve forward fair itermin = 0;

The maximum and minimum number of iterations done in the Fair-Taylor algorithm.

 

option solve forward nfair conv = conv1; [conv1|conv2]

Set Newton-Fair-Taylor convergence type to cnv1 (default) or conv2'. This corresponds to the criteria used in the option solve gauss conv ... options.

 

option solve forward method = fair; [fair|nfair|none]

The method used regarding leaded endogenous variables. If set to fair, the Fair-Taylor algorithm is used, and if set to nair, the Newton-Fair-Taylor method us used. If set to none, no forward-looking method is used. In that case, the leaded endogenous variables are just taken exogenously as their databank values.

 

option solve forward nfair conv1 abs = 0.001;

option solve forward nfair conv1 rel = 0.001;

Relative criterion for the (default) conv1-type convergence check, and absolute criterion for the (default) conv1-type convergence check. Note that the criteria are less strict than the corresponding Gauss criteria.

 

option solve forward nfair conv2 tabs = 1.0;

option solve forward nfair conv2 trel = 0.001;

Relative criterion for the PCIM-like conv2-type convergence check, and absolute criterion for the PCIM-like conv2-type convergence check. Note that the criteria are less strict than the corresponding Gauss criteria.

 

option solve forward nfair damp = 0.0;

Damping used regarding leaded endogenous variables in the Newton-Fair-Taylor algorithm. The smaller the factor is, the harder the damping. Setting the factor to 1.0 means no damping at all, whereas setting it to 0.0 means the equations cannot progress.

 

option solve forward nfair itermax = 200;

option solve forward nfair itermin = 0;

The maximum and minimum number of iterations done in the Newton-Fair-Taylor algorithm. Usually this algorithm need far fewer iterations than standard Fair-Taylor.

 

option solve forward nfair updatefreq = 100;

How often the Jacobi matrix is updated in the Newton-Fair-Taylor algorithm. For hard problems, you may set updatefreq = 1.

 

option solve forward terminal = const; [const|growth|exo]

This sets terminal conditions regarding leaded endogenous variables. If the simulation period ends in 2100, y[+1] in that period will be set to the value y is solved for in 2100 (and not the databank value for y in 2101). With growth, y[+1] in 2100 will use the growth rate instead of the level for the solved y in 2100. If the option is set to none, y[+1] in 2100 will be taken as the databank value of y in 2101 (this is often not a good choice).

 

option solve forward terminal feed = internal; [internal|external]

This is a technical option that decides wheather the terminal values are used inside one Fair-Taylor iteration, or only between them.

 

option solve gauss conv = conv1;

Set Gauss convergence type to conv1 (default) or conv2. Read more about convergence criteria in the help file related to the statement ITERSHOW.

 

option solve gauss conv1 abs = 0.0001;

option solve gauss conv1 rel = 0.0001;

Relative criterion for the (default) conv1-type convergence check, and absolute criterion for the (default) conv1-type convergence check.

 

option solve gauss conv2 tabs = 1.0;

option solve gauss conv2 trel = 0.0001;

Relative criterion for the PCIM-like conv2-type convergence check, and absolute criterion for the PCIM-like conv2-type convergence check.

 

option solve gauss conv ignorevars = yes; [yes|no]

If active, variables indicated by means of the CHECKOFF statement will be ignored regarding convergence check.

 

option solve gauss damp = 0.5;

In the Gauss algorithm, this damps any equations with damping set with the given factor. The larger the factor is, the harder the damping. Setting the factor to 0.0 means no damping at all, whereas setting it to 1.0 means the equations cannot progress. The damped equations have a 'Z' in their formula codes.

 

option solve gauss dump = no; [yes|no]

This option activates recording of Gauss iterations, for later inspection by means of the ITERSHOW statement. Beware that the option may use a lot of RAM, and that it slows down simulations considerably.

 

option solve gauss itermax = 200;

option solve gauss itermin = 10;

The maximum and minimum number of iterations done in the Gauss algorithm.

 

option solve gauss reorder = no; [yes|no]

When active, this option reorders equations in the simultaneous block of the model. This should normally reduce the number of required Gauss iterations for solving the model, but it may sometimes induce starting value problems (therefore the option is set to no as default). The option should be issued before a MODEL statement to take effect.

 

option solve method = gauss; [gauss|newton]

Choose between gauss or newton

 

option solve newton backtrack = yes; [yes|no]

If yes, the Newton algorithm tries to backtrack if an iteration step seems too large.

 

option solve newton conv abs = 0.0001;

Sets the absolute Newton convergence criterion. This is the value that the square root of the sum of squared residuals in all the equations may not exceed. So any residual will be (numerically) lower than this value, and usually a lot lower (since there are many equations).

 

option solve newton invert = lu; [lu|iter]

The algorithm used to invert the Jacobian matrix. The lu option is usually the most robust.

 

option solve newton itermax = 200;

The maximum number of iterations done in the Newton algorithm, before exiting.

 

option solve newton robust = yes; [yes|no]

With this option set, the Newton method will be more robust regarding starting values that normally would result in a crash due to illegal values, such as, for instance, the logarithm of a negative number etc. The robust mode is experimental, but if the starting values are legal, robust = yes will perform exactly the same iterations as robust = no. See also option solve failsafe.

 

option solve newton updatefreq = 15;

This options indicates how often the Newton algorithm should update the Jacobi matrix, when doing fast steps.

 

option solve print details = no; [yes|no]

If yes, the Newton algorithm will produce quite a lot of extra information regarding the iterations.

 

option solve print iter = no; [yes|no]

If yes, the individual periods are printed out while simulating. Set to no as default.

 

option solve static = no; [yes|no]

If yes, all lagged endogenous values are taken as their databank values (i.e. not their simulated values). See also SIM<static> local option.

 


 

option string interpolate format val = ''; [string]

When insterting values inside a strings, Gekko can format the values in different ways. Use '0.000' for 3 decimals, '12:0.000' for 3 decimals inside a 12 chars wide field, '12:F3' for the same, '-12:0.000' left-aligned. Instead of 0's, #'s can be used, too. See also the STRING help page, and the format() in-built function.

 


 

option system code split = 20; [0 or positive integer]

This is a very technical option related to how Gekko compiles Gekko program files. If > 0, long non-looping program files are internally chopped up in smaller chunks which are put into their own C#-methods. This eases the life of the C# compiler, especially for large/long files. The option tells how many lines of .gcm code are bundled into sub-methods at a time. A value of 20 seems good regarding speed, but the special value 0 switches this splitting off altogether. So you may try the value 0, if Gekko breaks down for mysterious reasons.

 

option system clone = yes; [yes|no]

This is a very technical option related to how user-defined functions and procedures behave. If set active (default), when calling a function like %= f(#x);, Gekko will clone the function arguments, so that there can be no side-effects on the function arguments after the function call is done. The option may cost some performance/speed if a function is called with very large objects, like very large matrices etc. Setting the option = no only applies to the types series, list, map and matrix (scalars never have side-effects).

 

option system read encoding = auto; [ansi|utf8|auto]

Determines the character encoding when reading text files. With auto (default), Gekko will 'taste' the file to see whether it is ANSI or UTF-8, and try to read it in the right encoding. You can use ansi to force ANSI encoding, or utf8 to force UTF-8 encoding. ANSI is the old Windows-1252 standard, which is nowadays mostly replaced by UTF-8 encoding. Beware that auto (but not the other options) also changes Unicode "no-break space" into normal space, and removes any Unicode "soft hyphen" (these Unicodes may appear when copy-pasting from html pages, and Gekko will choke on them).

 

option system write encoding = ansi; [ansi|utf8]

Determines the character encoding when writing text files. You can use ansi (default) to force ANSI encoding, or utf8 to force UTF-8 encoding. ANSI is the old Windows-1252 standard, which is nowadays mostly replaced with UTF-8 encoding. In the longer run, the default setting for Gekko will become utf8.

 

option system write utf8 bom = yes; [yes|no]

When option system write encoding = utf8 has been chosen, the bom option indicates whether a byte order mark should be included or not, when writing a text file. Byte order marks are in any case superfluous for UTF-8 (UTF-8 files have no byte order), but they are often added to indicate that the file is an UTF8-file. You may use option system write utf8 bom = no to omit byte order marks when UTF-8 files are written.

 

option system threads = 5; [yes|no]

Max number of threads used for reading/writing from cache.

 


 

option table decimalseparator = period; [comma|period]

The type of decimal separator used.

 

option table html datawidth = 5.5;

For html tables, this is the minimum width of data columns, in so-called 'em' units (in CSS: "width: 5.5em"). The 'em' units are independent of font size.

 

option table html firstcolwidth = 5.5;

For html tables, this is the minimum width of the first column, in so-called 'em' units (in CSS: "width: 5.5em"). The 'em' units are independent of font size.

 

option table html font = Arial;

option table html fontsize = 72;

You may choose the font and fontsize for html tables. The fontsize is in percent, so 72 corresponds to 72% (in CSS: "font-size: 72%").

 

option table html secondcolwidth = 5.5;

For html tables, this is the minimum width of the second column (sometimes containing variable names), in so-called 'em' units (in CSS: "width: 5.5em"). The 'em' units are independent of font size.

 

option table html specialminus = no; [yes|no]

If yes, a non-breaking hyphen is insert instead of the normal minus character. This may avoid some breaking of numbers, but that hyphen is not good for copy-pasting to Excel via right-clicking the table. (But please use the copy-button in the user interface to copy a table to Excel).

 

option table ignoremissingvars = yes; [yes|no]

If yes, missing variables will be shown as 'M', just like missing values for existing variables.

 

option table mdateformat = ''; [string in quotes]

This option will change for instance "2020m1" to "Jan. 2020" regarding monthly table dates. Options are: 'english-short', 'english-long', 'danish-short', 'danish-long'. These can have a '-lower' appended, for instance 'english-short-lower' (lower first letter of the month). The option must be stated within single quotes.

 

option table stamp = yes; [yes|no]

If yes, a date and time stamp is added to tables.

 

option table thousandsseparator = no; [yes|no]

Can activate thousandsseparator (either period or comma, depending upon option table decimalseparator). Note that you can now use negative decimals places. For instance, using varformat="f9.-2" in the gtb file, numbers are rounded to nearest hundreds. Combining these two, a number like 12345 would be printed as "12.300" or "12,300" depending on the decimalseparator.

 

option table type = html; [txt|html]

If set to txt, tables will be shown in text format in the Main tab. If set to html, .html format will be used (shown in the Menu tab). There are some options to control the html layout: see option table html ....

 


 

option timefilter = no; [yes|no]

Switches the timerfilter on or off (provided a timerfilter has been defined). See TIMEFILTER.

 

option timefilter type = hide; [hide|avg]

If set to hide, applying a timefilter will just hide the out-filtered periods (i.e., they are not shown). If avg is used instead, the non-shown periods will be aggregated into the shown periods (as averages). See TIMEFILTER.

 

 


 

Note

 

As stated above, you may omit the '=' in option statements, but it may be a good idea to keep it in programs for readability.

 

Setting option  interface suggestions = option (which is default) will help the user navigate the option tree.

 

For setting temporary options, see the BLOCK structure.