Grocer Function
NAME
overlay - overlay several ts
CALLING SEQUENCE
tsout=overlay(argi)
PARAMETERS
Input
Output
- tsout = a timeseries whose periodicity is the periodicity of the first argument (other series with another periodicity are ignored) and whose date range runs from the earliest startdate of any of the input series to the latest enddate of any of the series. For each date in the output series, OVERLAY searches the argument list from left to right looking for a non-NA value in the corresponding position of an input series, or an input argument which is a non-NA constant. The first such value found is placed in the output series in that position. If none is found, then an NA is placed in the output series.
DESCRIPTION
The same as the portable troll function overlay. Creates a timeseries by overlaying several timeseries.
EXAMPLE
if x is a ts defined over the time span '10a'-'20a', y a ts defined over the time span '19a-28a' and z a ts defined over the time span '1a'-'35a':
1) u = overlay(x,y)
2) u = overlay(x,z)
3) u = overlay(x,z,y)
4) u = overlay(z,y)
Example 1 gives the ts defined over the time span '10a'-'28a', equal to x over the time span '10a'-'20a', equal to y over the time span '21a-28a'.
Example 2 gives the ts defined over the time span '1a'-'35a', equal to z over the time span '1a-9a', equal to x over the time span '10a'-'20a', equal to z over the time span '21a-35a'.
Example 3 gives the same result as example2.
Example 4 gives z.
AUTHOR
Eric Dubois 2002