<< q2a Time series reshape >>

Grocer >> Time series > q2m

q2m

expand a quarterly series into a monthly one

CALLING SEQUENCE

tsout=q2m(tsin)

PARAMETERS

Input

* tsin = a quarterly time series

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

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

   . 0 if each monthly value is equal to the quarterly one divided by 3

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

Output

* tsout = the corresponding monthly time series

DESCRIPTION

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

EXAMPLE

x = reshape([1:35],'1978q1') // ceate a quarterly ts
y = q2m(x) 
// gives a montly ts, from 1978m1 to 2012m12 with values 1 for all months of the first quarter of year 1978, 
// 2 for all months of the second quarter of year 1979...

AUTHOR

Eric Dubois 2020

Report an issue
<< q2a Time series reshape >>