INTERPOLATE

<< Click to Display Table of Contents >>

Navigation:  Gekko commands >

INTERPOLATE

Previous pageReturn to chapter overviewNext page

INTERPOLATE transforms one lower-frequency timeseries to a higher-frequency timeseries, for instance converting annual data to quarterly data. Use COLLAPSE to perform the inverse transformation. INTERPOLATE does not yet support daily frequency.

 

 


 

Syntax

 

INTERPOLATE vars1 = vars2  method;

 

vars1

Higher frequency timeseries. Frequency can be indicated with suffix !a, !q or !m. Banknames may be used. Lists can be use like for instance {#m}.

vars2

Lower-frequencey timeseries. Frequency can be indicated with suffix !a, !q or !m. Banknames may be used. Lists can be use like for instance {#m}

method

(Optional). Choose between:

 

repeat: Repeats the lower-freq observation (rep may be used as synonym)

prorate: Also repeats, but divides the result so that the sum of the higher-freq observations corresponds to the lower-freq observation.

 

Note: default is repeat. More methods may be added by popular demand.

 

If a variable without databank indication is not found in the first-position databank, Gekko will look for it in other open databanks if databank search is active (cf. MODE).

 

 


 

Example

 

Use this to convert frequency:

 

INTERPOLATE x!= x!a;

 

Since the method is repeat as default, this will create the quarterly timeseries x where each quarterly observation in x!q is the same as the corresponding annual observation in x!a.

 

INTERPOLATE qbank:x!= abank:x!a prorate;

 

With option prorate, the quarters will sum up to x!a instead of just being repeated.

 

 


 

Note

 

If a frequency indicator is omitted, Gekko will use the current frequency.

 

More to come by popular demand, for instance using patterns, splines, etc., to create the high-frequency series.

 

 

 


 

Related commands

 

COLLAPSE, SERIES, CREATE, PRT