IRIS Toolbox Reference Manual

cumsumk

Cumulative sum with a k-period leap

Syntax

Y = cumsumk(X,K,Rho,Range)
Y = cumsumk(X,K,Rho)
Y = cumsumk(X,K)
Y = cumsumk(X)

Input arguments

Output arguments

Options

Description

If K < 0, the first K observations in the output series Y are copied from X, and the new observations are given recursively by

Y{t} = Rho*Y{t-K} + X{t}.

If K > 0, the last K observations in the output series Y are copied from X, and the new observations are given recursively by

Y{t} = Rho*Y{t+K} + X{t},

going backwards in time.

If K == 0, the input data are returned.

Example

Construct random data with seasonal pattern, and run X12 to seasonally adjust these series.

x = tseries(qq(1990,1):qq(2020,4),@randn);
x1 = cumsumk(x,-4,1);
x2 = cumsumk(x,-4,0.7);
x1sa = x12(x1);
x2sa = x12(x2);

The new series x1 will be a unit-root process while x2 will be stationary. Note that the command on the second line could be replaced with x1 = cumsumk(x).