Optional arguments in IRIS functions

The IRIS functions have usually two types of input arguments. First, you specify the required arguments, which come in a fixed order. After them, you can specify some (or all or none) of the optional arguments. Each optional argument comes as a name-value pair, and you can enter them in any order.

Example:

One of the input arguments of the hpf function (the Hodrick-Prescott filter) is 'lambda', the smoothing parameter. Its default setting depends on the periodicity of the input times series: it is e.g. 1600 for quarterly times series (you can check "help tseries/hpf" for all options). Hence, if you run the function without any optional arguments, i.e.

  [xtnd,xgap] = hpf(x,qq(1990,1):qq(2006,4));
where x is a quarterly times series, you obtain a trend and gap based on this default lambda.

To use a different lambda (say 3200 instead of 1600) you simply need to run

  [xtnd,xgap] = hpf(x,qq(1990,1):qq(2006,4),'lambda',3200);
instead.

The first two input arguments, i.e. the time series itself and the range, are required. The optional argument(s) then follow(s) the required ones; note also that the names of optional arguments must be entered as character strings, and hence enclosed in single quotes. If you do not specify some of a function's optional arguments, then the default values are used. You can check the default values in on-line help.