exatrpolates series in a tsmat
tsmat2=tsmat_extrap(tsmat,arg1,...,argn)
* tsmat = a tsmat
* arg1,...,argn = N sequences variable,bounds,type_extrap,vari_extrap with:
- variable = a string, the names of a variable in the tsmat that will be extrapolated
- bounds = the bounds over which the extrapolation is made
- type_extrap = a string, the way the extrapolation will be made
* 'level' if it is done by entering its values in vari_extrap;
* 'growthr rate' if it is done by applying the growth rate given in vari_extrap to the previous value;
* 'delta rate' if it is done by adding the value(s) given in vari_extrap to the previous one;
* 'av growth rate' is like 'growth rate' but with the average growth rate calculated on the last vari_extrap periods;
* 'series' together with the name of a series vari_extrap existing in the tsmat applies to the extrapolated series the growth rates of the reference series, over the chosen time bounds.
- vari_extrap = a string, a scalar or a vector of the size of the bounds, providing the name of the variables or the svalue(s) or used for extrapolation
* tsmat2 = the original tsmat with the given variables extrapolated
global GROCERDIR; // load the database small_db: load(GROCERDIR+'\data\small_db.dat') // extrapolate variables demmon with a 1% growth rate, time with a 1 increment and trim1 // (first quarter), with the values [1;0;0;0] over period ['2007q1';'2007q4']: small_ext=tsmat_extrap(small_db,'demmon',['2007q1';'2007q4'],'growth rate',0.01,... 'time',['2007q1';'2007q4'],'delta rate',1,... 'trim1',['2007q1';'2007q4'],'level',[1;0;0;0],... 'petfx',['2007q1';'2007q4'],'av growth rate',8,... 'petfm',['2007q1';'2007q4'],'series','petfx'); // note here that the values of one variable can be exatrapolated by the values of an extrapolated variable // provided that variable used for extrapolation has itself been put before the one to extrapolate // check that the new values have been taken into account in the new database and that // this is not the case for variable trim2: prt_tsmat('level',['2006q1';'2007q4'],list('small_ext'),['demmon';'time';'trim1';'petfx';'petfm';'trim2']) | ![]() | ![]() |