|
<< Click to Display Table of Contents >> Options |
![]() ![]()
|
Four types of options Gekko operates with four types of options: global options, general options, block-options and local options. Global options are read when Gekko launches and cannot be altered later on (they have the form option global ...). General 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. |
Global options
Global options have the form option global ... and can only be set programatically in the gekko.ini file next to the Gekko.exe file (cf. INI). These options are primarily for advanced users.
General options
If you need to use an option for the whole (remainder of the) Gekko program, you just use a general option. This may be an option like setting the frequency.
option freq = a; |
This will produce the series x1!a = 1, x1!q = 2 and x2!a = 3. (Instead of changing the frequency you could in this case have used x1!q = 2;, but the example is for illustrative purposes).
Block options
Switching general options back and forth can be error-prone and tedious, so therefore Gekko offers to use a BLOCK statement:
option freq = a; |
When BLOCK is encountered, it works like setting option freq = q;, but when the END is encountered, option freq = ... is restored to what it was before the BLOCK statement. BLOCK is particularly practical when the option applies to several Gekko statements.
Local options
Local options are the last type, applying to exactly one Gekko statement. The option is put inside the <> local option field, and many statements have taylor-made local options to control the behavior. Examples:
read <csv> data1; //<csv> means csv file type |
In addition to such taylor-made local options, you may also use general options and put them into the <> field. Example:
option freq = a; |
Here, the general option option freq = q is used, but it applies only to that particular statement. If you need to mix taylor-made local options with general options, put the general options last, after a semicolon (;). For instance:
option freq = q; |
The green 2020q1 2021q2 p part are normal taylor-made print options: setting the time period and choosing operator p (percentage growth). The blue ; option print freq = simple; option series data missing = zero part contains general options from the OPTION statement.
Sometimes, a general option already exists as a taylor-made local option for the command. For instance, continuing from the previous example, these two statements are equivalent:
prt <2020q1 2021q2 collapse = total> y; |
When an equivalent taylor-made option exists, it is recommended to just use that option.
Functions
Local options do not work for functions (yet). Future syntax could be something like this:
y = f(<2020q1 2021q2; option series data missing = zero>, x1 + x2); |