compute parametric spectral analysis of time series
[rspec]=specvarma(result,arg1,...,argn)
* result = tlist estimation result from OLS,VAR or VARMA methods (warning: no constant is allowed !)
* arg1,...,argn = arguments which can be:
- the string 'noprint' if the user doesn't want to display the results of the regression
- optional arguments that can be the following:
.'trunc=xx' : lag window size (the default value is k=round(sqrt(T)))
.'weight=xx' : (N x 1) vector of weights (equal weights by default) for cohesion
.spec=1' : plot spectrum
.'cospe=1' : plot cospectrum
.'dcorr=1' : plot dynamic correlation
.'phase=1' : plot phase spectrum
.'coher=1' : plot coherency
.'cohes=1' : plot cohesion
.'ic =1' : performs delta-method estimation of confidence band
* rspec = a results tlist with
- rspec('cospe') = matrix of cospectra
- rspec('cohes') = matrix of cohesion (if more than one TS)
- rspec('coher') = matrix of coherence (if more than one TS)
- rspec('dcorr') = matrix of dynamic correlations (if more than one TS)
- rspec('phase') = matrix of standardized phase spectrum (if more than one TS)
- rspec('order') = order of arrival of variable in cross-products
- rspec('ucohes') = matrix of upper bound for cohesion (compute by block-bootstrap)
- rspec('lcohes') = matrix of lower bound for cohesion (compute by block-bootstrap)
- rspec('ucoher') = matrix of upper bound for coherency (compute by block-bootstrap)
- rspec('lcoher') = matrix of lower bound for coherency (compute by block-bootstrap)
- rspec('ucospe') = matrix of upper bound for cospectra (compute by block-bootstrap)
- rspec('lcospe') = matrix of upper bound for cospectra (compute by block-bootstrap)
- rspec('udcorr') = matrix of upper bound for dynamic correlations (compute by block-bootstrap)
- rspec('ldcorr') = matrix of lower bound for dynamic correlations (compute by block-bootstrap)
- rspec('uphase') = matrix of upper bound for phase spectrum (compute by block-bootstrap)
- rspec('lphase') = matrix of lower bound for phase spectrum (compute by block-bootstrap)
load(GROCERDIR+'\data\specgdp.dat'); // get the names of the variables available in the database lvar =dblist(GROCERDIR+'\data\specgdp.dat'); // transforms by log and first difference // & center data for i = 1:size(lvar,1) execstr('dl'+lvar(i)+' = delts(log('+lvar(i)+'))') execstr('dl'+lvar(i)+'_m = dl'+lvar(i)+' - mean(dl'+lvar(i)+')') end // estimate var(4) model with no constant rvar = VAR(4,'endo=dlfr_m;dlger_m;dlit_m;dlsp_m','nocte','noprint') // estimates and prints cohesion of var model // and compute 95% interval confidence band rspec = specvarma(rvar,'cohes=1','ic=1'); // Example taken from function specvarma_d. A var model is estimated on // the variations of logarithm of the French, German, Italian and Spanish GDP. // The cohesion of these 4 series is plotted ('cohes=1') with the confidence band calculated by the mean of the delta method. | ![]() | ![]() |