T = trec(Dates)
Dates
[ numeric ] - Vector of dates or date range on which the final time-recursive expression will be evaluated.T
[ trec ] - New time-recursive subscript object.Time-recursive subscript objects are used to reference tseries objects on both the left-hand side and the right-hand side of a time-recursive assignment. The assignment is then evaluated for each date in Dates
, from the first to the last.
See more on time-recursive expressions in Contents, including the description of instances in which IRIS fails to evaluate the time-recursive expressions correctly.
Construct a first-order autoregressive process with normally distributed residuals:
T = trec(qq(2010,1):qq(2020,4));
x = tseries(qq(2009,4),10);
e = tseries(qq(2010,1):qq(2020,4),@randn);
x(T) = 10 + 0.8*x(T-1) + e(T);