<< Time series Time series a2q >>

Grocer >> Time series > a2m

a2m

expand an annual series into a monthly one

CALLING SEQUENCE

tsout=a2m(tsin,option)

PARAMETERS

Input

* tsin = an annual time series

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

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

   . 0 if each monthly value is equal to the annual one divided by 12

   . 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 monthly time series

DESCRIPTION

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

EXAMPLE

x = reshape([1:35],'1978a') // create an annual ts
y = a2m(x) 
// gives an montly ts, from 1978m1 to 2012m12 with values 1 for all months of year 1978, 
// 2 for all months of year 1979...
y = a2m(x,12)
// gives a monthly ts from 1978m1 to 2012m12 with %nan values for all non December months
// and 1 for December 1978, 2 for December 1976...

AUTHOR

Eric Dubois 2020

Report an issue
<< Time series Time series a2q >>