<< q2a Time series seasdummy >>

Grocer >> Time series > reshape

reshape

creation of a ts from a vector

CALLING SEQUENCE

ts=reshape(mat,datin,indw)

PARAMETERS

Input

* mat = a (1 x nobs) or (nobs x 1) vector

* datin = a date string

* indw = 'w' if the time series is weekly (optional)

 

Output

* ts = the corresponding time series

DESCRIPTION

Creates a time series from a vector of values and a beginning date.

EXAMPLE

x = reshape([21:44],'1a') // creates an annual ts, from the year 1 to the year 24, with values 21 to 44.
x = reshape([1:24]','1985q1') // creates a quarterly ts, from the first quarter of 1985 to the last quarter of 2000, with values 1 to 24
x = reshape(grand(365,1,'nor',0,1),'1985/12/01') // creates a daily ts, from 1985/12/01 to 1986/11/30, with random normal values
x = reshape(grand(365,1,'nor',0,1),'1985/12/01','w') // creates a weekly ts, from the first week of december 1985 to the third week of november 1992, with random normal values
 
// Note that the data are given as a row vector in example 1 and a column vector in example 2: it doesn't matter, provided that you don't give a matrix with more than one dimension.

AUTHOR

Eric Dubois 2002-2007

Report an issue
<< q2a Time series seasdummy >>