Grocer Function

NAME

m2q - transforms monthly data into quarterly ones

CALLING SEQUENCE

tsout=m2q(tsin,ind)

PARAMETERS

Input

Output

DESCRIPTION

Transforms monthly data into quarterly ones.

EXAMPLE

if x is a monthly ts (such as reshape([1:24],'1978m2') then
1) y = m2q(x)
2) y = m2q(x,-1)
3) y = m2q(x,3)

Examples 1 and 2 give exactly the same result: a quarterly ts (from 1978q2 to 1979q4 with values 12, 21, 30, 39, 48, 57, 66 with the ts x above). Example 3 gives a quarterly ts whose values come from the third month of each quarter (from 1978q1 to 1979q4 with values 2, 5, 8, 11, 14, 17, 20, 23 with the ts x above).

AUTHOR

Eric Dubois 2002