<< a2m Time series b2m >>

Grocer >> Time series > a2q

a2q

expand an annual series into a quarterly one

CALLING SEQUENCE

tsout=a2q(tsin)

PARAMETERS

Input

* tsin = an annual time series

* option = an integer, between -1 and 3:

   . -1 if each quarterly value is equal to the annual one (default if the argument is not given)

   . 0 if each quarterly value is equal to the annual one divided by 4

   . n if the value of the n-th month is equal to the annual one and the others are set to %nan

Output

* tsout = the corresponding quarterly time series

DESCRIPTION

Expands an annual series into a quarterly one, with various options for the resulting quarterly values.

EXAMPLE

x = reshape([1:35],'1978a') // create an annual ts
y = a2q(x) 
// gives an montly ts, from 1978q1 to 2012q4 with values 1 for all quarters of year 1978, 
// 2 for all quarters of year 1979...
y = a2q(x,4)
// gives a quarterly ts from 1978q1 to 2012q4 with %nan values for all quarters except the last one of the year
// and 1 for the 4-th quarter of 1978, 2 for December 1976...

AUTHOR

Eric Dubois 2020

Report an issue
<< a2m Time series b2m >>