IRIS Toolbox Reference Manual

dat2ttrend

Construct linear time trend from date range

Syntax

[TTrend,BaseDate] = dat2ttrend(Range)
[TTrend,BaseDate] = dat2ttrend(Range,BaseYear)
[TTrend,BaseDate] = dat2ttrend(Range,Obj)

Input arguments

Output arguments

Description

For regular date frequencies, the time trend is constructed the following way. First, a base date is created first period in the base year of a given frequency. For instance, for a quarterly input range, BaseDate = qq(baseYear,1), for a monthly input range, BaseDate == mm(baseYear,1), etc. Then, the output trend is an integer vector normalized to the base date,

TTrend = floor(Range - BaseDate);

For indeterminate date frequencies, BaseDate = 0, and the output time trend is simply the input date range.

Example