]> Creatis software - CreaPhase.git/blob - octave_packages/tsa-4.2.4/doc-cache
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / tsa-4.2.4 / doc-cache
1 # Created by Octave 3.6.1, Thu Apr 05 12:32:56 2012 UTC <root@brouzouf>
2 # name: cache
3 # type: cell
4 # rows: 3
5 # columns: 55
6 # name: <cell-element>
7 # type: sq_string
8 # elements: 1
9 # length: 3
10 aar
11
12
13 # name: <cell-element>
14 # type: sq_string
15 # elements: 1
16 # length: 2198
17  Calculates adaptive autoregressive (AAR) and adaptive autoregressive moving average estimates (AARMA)
18  of real-valued data series using Kalman filter algorithm.
19  [a,e,REV] = aar(y, mode, MOP, UC, a0, A, W, V); 
20
21  The AAR process is described as following  
22        y(k) - a(k,1)*y(t-1) -...- a(k,p)*y(t-p) = e(k);
23  The AARMA process is described as following  
24        y(k) - a(k,1)*y(t-1) -...- a(k,p)*y(t-p) = e(k) + b(k,1)*e(t-1) + ... + b(k,q)*e(t-q);
25
26  Input:
27        y       Signal (AR-Process)
28        Mode    is a two-element vector [aMode, vMode], 
29                aMode determines 1 (out of 12) methods for updating the co-variance matrix (see also [1])
30                vMode determines 1 (out of 7) methods for estimating the innovation variance (see also [1])
31                aMode=1, vmode=2 is the RLS algorithm as used in [2]
32                aMode=-1, LMS algorithm (signal normalized)
33                aMode=-2, LMS algorithm with adaptive normalization  
34                                      
35        MOP     model order, default [10,0] 
36                MOP=[p]         AAR(p) model. p AR parameters
37                MOP=[p,q]       AARMA(p,q) model, p AR parameters and q MA coefficients
38        UC      Update Coefficient, default 0
39        a0      Initial AAR parameters [a(0,1), a(0,2), ..., a(0,p),b(0,1),b(0,2), ..., b(0,q)]
40                 (row vector with p+q elements, default zeros(1,p) )
41        A       Initial Covariance matrix (positive definite pxp-matrix, default eye(p))
42         W       system noise (required for aMode==0)
43         V       observation noise (required for vMode==0)
44       
45  Output:
46        a       AAR(MA) estimates [a(k,1), a(k,2), ..., a(k,p),b(k,1),b(k,2), ..., b(k,q]
47        e       error process (Adaptively filtered process)
48        REV     relative error variance MSE/MSY
49
50
51  Hint:
52  The mean square (prediction) error of different variants is useful for determining the free parameters (Mode, MOP, UC) 
53
54  REFERENCE(S): 
55  [1] A. Schloegl (2000), The electroencephalogram and the adaptive autoregressive model: theory and applications. 
56      ISBN 3-8265-7640-3 Shaker Verlag, Aachen, Germany. 
57
58  More references can be found at 
59      http://www.dpmi.tu-graz.ac.at/~schloegl/publications/
60
61
62
63 # name: <cell-element>
64 # type: sq_string
65 # elements: 1
66 # length: 80
67  Calculates adaptive autoregressive (AAR) and adaptive autoregressive moving ave
68
69
70
71 # name: <cell-element>
72 # type: sq_string
73 # elements: 1
74 # length: 6
75 aarmam
76
77
78 # name: <cell-element>
79 # type: sq_string
80 # elements: 1
81 # length: 1372
82  Estimating Adaptive AutoRegressive-Moving-Average-and-mean model (includes mean term) 
83
84  !! This function is obsolete and is replaced by AMARMA
85
86  [z,E,REV,ESU,V,Z,SPUR] = aarmam(y, mode, MOP, UC, z0, Z0, V0, W); 
87  Estimates AAR parameters with Kalman filter algorithm
88         y(t) = sum_i(a_i(t)*y(t-i)) + m(t) + e(t) + sum_i(b_i(t)*e(t-i))
89
90  State space model
91         z(t) = G*z(t-1) + w(t)    w(t)=N(0,W) 
92         y(t) = H*z(t)   + v(t)    v(t)=N(0,V)   
93
94  G = I, 
95  z = [m(t),a_1(t-1),..,a_p(t-p),b_1(t-1),...,b_q(t-q)];
96  H = [1,y(t-1),..,y(t-p),e(t-1),...,e(t-q)];
97  W = E{(z(t)-G*z(t-1))*(z(t)-G*z(t-1))'}
98  V = E{(y(t)-H*z(t-1))*(y(t)-H*z(t-1))'}
99
100
101  Input:
102        y        Signal (AR-Process)
103        Mode     determines the type of algorithm
104
105        MOP     Model order [m,p,q], default [0,10,0]
106                         m=1 includes the mean term, m=0 does not. 
107                         p and q must be positive integers
108                         it is recommended to set q=0. 
109         UC      Update Coefficient, default 0
110         z0      Initial state vector
111         Z0      Initial Covariance matrix
112       
113  Output:
114         z       AR-Parameter
115         E       error process (Adaptively filtered process)
116        REV     relative error variance MSE/MSY
117
118  REFERENCE(S): 
119  [1] A. Schloegl (2000), The electroencephalogram and the adaptive autoregressive model: theory and applications. 
120      ISBN 3-8265-7640-3 Shaker Verlag, Aachen, Germany. 
121
122  More references can be found at 
123      http://pub.ist.ac.at/~schloegl/publications/
124
125
126
127 # name: <cell-element>
128 # type: sq_string
129 # elements: 1
130 # length: 80
131  Estimating Adaptive AutoRegressive-Moving-Average-and-mean model (includes mean
132
133
134
135 # name: <cell-element>
136 # type: sq_string
137 # elements: 1
138 # length: 7
139 ac2poly
140
141
142 # name: <cell-element>
143 # type: sq_string
144 # elements: 1
145 # length: 179
146  converts the autocorrelation sequence into an AR polynomial
147  [A,Efinal] = ac2poly(r)
148
149  see also ACOVF ACORF AR2RC RC2AR DURLEV AC2POLY, POLY2RC, RC2POLY, RC2AC, AC2RC, POLY2AC
150  
151
152
153
154 # name: <cell-element>
155 # type: sq_string
156 # elements: 1
157 # length: 80
158  converts the autocorrelation sequence into an AR polynomial
159  [A,Efinal] = ac2po
160
161
162
163 # name: <cell-element>
164 # type: sq_string
165 # elements: 1
166 # length: 5
167 ac2rc
168
169
170 # name: <cell-element>
171 # type: sq_string
172 # elements: 1
173 # length: 182
174  converts the autocorrelation function into reflection coefficients 
175  [RC,r0] = ac2rc(r)
176
177  see also ACOVF ACORF AR2RC RC2AR DURLEV AC2POLY, POLY2RC, RC2POLY, RC2AC, AC2RC, POLY2AC
178  
179
180
181
182 # name: <cell-element>
183 # type: sq_string
184 # elements: 1
185 # length: 80
186  converts the autocorrelation function into reflection coefficients 
187  [RC,r0] = 
188
189
190
191 # name: <cell-element>
192 # type: sq_string
193 # elements: 1
194 # length: 5
195 acorf
196
197
198 # name: <cell-element>
199 # type: sq_string
200 # elements: 1
201 # length: 1078
202   Calculates autocorrelations for multiple data series.
203   Missing values in Z (NaN) are considered. 
204   Also calculates Ljung-Box Q stats and p-values.
205
206     [AutoCorr,stderr,lpq,qpval] = acorf(Z,N);
207   If mean should be removed use
208     [AutoCorr,stderr,lpq,qpval] = acorf(detrend(Z',0)',N);
209   If trend should be removed use
210     [AutoCorr,stderr,lpq,qpval] = acorf(detrend(Z')',N);
211
212  INPUT
213   Z     is data series for which autocorrelations are required
214        each in a row
215   N     maximum lag
216
217  OUTPUT
218   AutoCorr nr x N matrix of autocorrelations
219   stderr   nr x N matrix of (approx) std errors
220   lpq      nr x M matrix of Ljung-Box Q stats
221   qpval    nr x N matrix of p-values on Q stats
222    
223  All input and output parameters are organized in rows, one row 
224  corresponds to one series
225
226  REFERENCES:
227   S. Haykin "Adaptive Filter Theory" 3ed. Prentice Hall, 1996.
228   M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. 
229   W.S. Wei "Time Series Analysis" Addison Wesley, 1990.
230   J.S. Bendat and A.G.Persol "Random Data: Analysis and Measurement procedures", Wiley, 1986.
231
232
233
234 # name: <cell-element>
235 # type: sq_string
236 # elements: 1
237 # length: 55
238   Calculates autocorrelations for multiple data series.
239
240
241
242 # name: <cell-element>
243 # type: sq_string
244 # elements: 1
245 # length: 5
246 acovf
247
248
249 # name: <cell-element>
250 # type: sq_string
251 # elements: 1
252 # length: 826
253  ACOVF estimates autocovariance function (not normalized)
254  NaN's are interpreted as missing values. 
255
256  [ACF,NN] = acovf(Z,MAXLAG,Mode);
257
258  Input:
259   Z    Signal (one channel per row);
260   MAXLAG  maximum lag
261   Mode  'biased'  : normalizes with N [default]
262         'unbiased': normalizes with N-lag
263         'coeff'   : normalizes such that lag 0 is 1     
264         others    : no normalization
265
266  Output:
267   ACF autocovariance function
268   NN  number of valid elements 
269
270  REFERENCES:
271   A.V. Oppenheim and R.W. Schafer, Digital Signal Processing, Prentice-Hall, 1975.
272   S. Haykin "Adaptive Filter Theory" 3ed. Prentice Hall, 1996.
273   M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. 
274   W.S. Wei "Time Series Analysis" Addison Wesley, 1990.
275   J.S. Bendat and A.G.Persol "Random Data: Analysis and Measurement procedures", Wiley, 1986.
276
277
278
279 # name: <cell-element>
280 # type: sq_string
281 # elements: 1
282 # length: 80
283  ACOVF estimates autocovariance function (not normalized)
284  NaN's are interpreted
285
286
287
288 # name: <cell-element>
289 # type: sq_string
290 # elements: 1
291 # length: 4
292 adim
293
294
295 # name: <cell-element>
296 # type: sq_string
297 # elements: 1
298 # length: 659
299  ADIM adaptive information matrix. Estimates the inverse
300    correlation matrix in an adaptive way. 
301
302  [IR, CC] = adim(U, UC [, IR0 [, CC0]]); 
303    U    input data  
304    UC   update coefficient 0 < UC << 1
305    IR0  initial information matrix
306    CC0 initial correlation matrix
307    IR   information matrix (inverse correlation matrix)
308    CC  correlation matrix
309         
310   The algorithm uses the Matrix Inversion Lemma, also known as 
311      "Woodbury's identity", to obtain a recursive algorithm.  
312      IR*CC - UC*I should be approx. zero. 
313
314  Reference(s):
315  [1] S. Haykin. Adaptive Filter Theory, Prentice Hall, Upper Saddle River, NJ, USA 
316      pp. 565-567, Equ. (13.16), 1996.
317
318
319
320 # name: <cell-element>
321 # type: sq_string
322 # elements: 1
323 # length: 34
324  ADIM adaptive information matrix.
325
326
327
328 # name: <cell-element>
329 # type: sq_string
330 # elements: 1
331 # length: 6
332 amarma
333
334
335 # name: <cell-element>
336 # type: sq_string
337 # elements: 1
338 # length: 1501
339  Adaptive Mean-AutoRegressive-Moving-Average model estimation
340  [z,E,ESU,REV,V,Z,SPUR] = amarma(y, mode, MOP, UC, z0, Z0, V0, W); 
341  Estimates AAR parameters with Kalman filter algorithm
342         y(t) = sum_i(a(i,t)*y(t-i)) + mu(t) + E(t)
343
344  State space model:
345         z(t)=G*z(t-1) + w(t)      w(t)=N(0,W) 
346         y(t)=H*z(t)   + v(t)      v(t)=N(0,V)   
347
348  G = I, 
349  z = [µ(t)/(1-sum_i(a(i,t))),a_1(t-1),..,a_p(t-p),b_1(t-1),...,b_q(t-q)];
350  H = [1,y(t-1),..,y(t-p),e(t-1),...,e(t-q)];
351  W = E{(z(t)-G*z(t-1))*(z(t)-G*z(t-1))'}
352  V = E{(y(t)-H*z(t-1))*(y(t)-H*z(t-1))'}
353
354  Input:
355        y        Signal (AR-Process)
356        Mode
357             [0,0] uses V0 and W  
358
359        MOP     Model order [m,p,q], default [0,10,0] 
360                         m=1 includes the mean term, m=0 does not. 
361                         p and q must be positive integers
362                         it is recommended to set q=0. 
363         UC      Update Coefficient, default 0
364         z0      Initial state vector
365         Z0      Initial Covariance matrix
366       
367  Output:
368         z       AR-Parameter
369         E       error process (Adaptively filtered process)
370        REV     relative error variance MSE/MSY
371
372
373  see also: AAR
374
375  REFERENCE(S): 
376  [1] A. Schloegl (2000), The electroencephalogram and the adaptive autoregressive model: theory and applications. 
377      ISBN 3-8265-7640-3 Shaker Verlag, Aachen, Germany. 
378  [2] Schlögl A, Lee FY, Bischof H, Pfurtscheller G
379      Characterization of Four-Class Motor Imagery EEG Data for the BCI-Competition 2005.
380      Journal of neural engineering 2 (2005) 4, S. L14-L22
381
382  More references can be found at 
383      http://www.dpmi.tu-graz.ac.at/~schloegl/publications/
384
385
386
387 # name: <cell-element>
388 # type: sq_string
389 # elements: 1
390 # length: 80
391  Adaptive Mean-AutoRegressive-Moving-Average model estimation
392  [z,E,ESU,REV,V,Z,
393
394
395
396 # name: <cell-element>
397 # type: sq_string
398 # elements: 1
399 # length: 7
400 ar2poly
401
402
403 # name: <cell-element>
404 # type: sq_string
405 # elements: 1
406 # length: 603
407  converts autoregressive parameters into AR polymials 
408  Multiple polynomials can be converted. 
409  function  [A] = ar2poly(AR);
410
411   INPUT:
412  AR     AR parameters, each row represents one set of AR parameters
413
414   OUTPUT
415  A     denominator polynom
416
417
418  see also ACOVF ACORF DURLEV RC2AR FILTER FREQZ ZPLANE
419  
420  REFERENCES:
421   P.J. Brockwell and R. A. Davis "Time Series: Theory and Methods", 2nd ed. Springer, 1991.
422   S. Haykin "Adaptive Filter Theory" 3rd ed. Prentice Hall, 1996.
423   M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. 
424   W.S. Wei "Time Series Analysis" Addison Wesley, 1990.
425
426
427
428 # name: <cell-element>
429 # type: sq_string
430 # elements: 1
431 # length: 80
432  converts autoregressive parameters into AR polymials 
433  Multiple polynomials can
434
435
436
437 # name: <cell-element>
438 # type: sq_string
439 # elements: 1
440 # length: 5
441 ar2rc
442
443
444 # name: <cell-element>
445 # type: sq_string
446 # elements: 1
447 # length: 1007
448  converts autoregressive parameters into reflection coefficients 
449  with the Durbin-Levinson recursion for multiple channels
450  function  [AR,RC,PE] = ar2rc(AR);
451  function  [MX,PE] = ar2rc(AR);
452
453   INPUT:
454  AR    autoregressive model parameter   
455
456   OUTPUT
457  AR    autoregressive model parameter   
458  RC    reflection coefficients (= -PARCOR coefficients)
459  PE    remaining error variance (relative to PE(1)=1)
460  MX    transformation matrix between ARP and RC (Attention: needs O(p^2) memory)
461         AR = MX(:,K*(K-1)/2+(1:K));
462         RC = MX(:,(1:K).*(2:K+1)/2);
463
464  All input and output parameters are organized in rows, one row 
465  corresponds to the parameters of one channel
466
467  see also ACOVF ACORF DURLEV RC2AR 
468  
469  REFERENCES:
470   P.J. Brockwell and R. A. Davis "Time Series: Theory and Methods", 2nd ed. Springer, 1991.
471   S. Haykin "Adaptive Filter Theory" 3rd ed. Prentice Hall, 1996.
472   M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. 
473   W.S. Wei "Time Series Analysis" Addison Wesley, 1990.
474
475
476
477 # name: <cell-element>
478 # type: sq_string
479 # elements: 1
480 # length: 80
481  converts autoregressive parameters into reflection coefficients 
482  with the Durb
483
484
485
486 # name: <cell-element>
487 # type: sq_string
488 # elements: 1
489 # length: 6
490 ar_spa
491
492
493 # name: <cell-element>
494 # type: sq_string
495 # elements: 1
496 # length: 1259
497  AR_SPA decomposes an AR-spectrum into its compontents 
498  [w,A,B,R,P,F,ip] = ar_spa(AR,fs,E);
499
500   INPUT:
501  AR   autoregressive parameters
502  fs    sampling rate, provide w and B in [Hz], if not given the result is in radians 
503  E     noise level (mean square),  gives A and F in units of E, if not given as relative amplitude
504
505   OUTPUT
506  w      center frequency
507  A     Amplitude
508  B     bandwidth
509        - less important output parameters - 
510  R      residual
511  P      poles
512  ip     number of complex conjugate poles
513  real(F)        power, absolute values are obtained by multiplying with noise variance E(p+1) 
514  imag(F)        assymetry, - " -
515
516  All input and output parameters are organized in rows, one row 
517  corresponds to the parameters of one channel
518
519  see also ACOVF ACORF DURLEV IDURLEV PARCOR YUWA 
520  
521  REFERENCES:
522  [1] Zetterberg L.H. (1969) Estimation of parameter for linear difference equation with application to EEG analysis. Math. Biosci., 5, 227-275. 
523  [2] Isaksson A. and Wennberg, A. (1975) Visual evaluation and computer analysis of the EEG - A comparison. Electroenceph. clin. Neurophysiol., 38: 79-86.
524  [3] G. Florian and G. Pfurtscheller (1994) Autoregressive model based spectral analysis with application to EEG. IIG - Report Series, University of Technolgy Graz, Austria.
525
526
527
528 # name: <cell-element>
529 # type: sq_string
530 # elements: 1
531 # length: 80
532  AR_SPA decomposes an AR-spectrum into its compontents 
533  [w,A,B,R,P,F,ip] = ar_s
534
535
536
537 # name: <cell-element>
538 # type: sq_string
539 # elements: 1
540 # length: 6
541 arcext
542
543
544 # name: <cell-element>
545 # type: sq_string
546 # elements: 1
547 # length: 738
548  ARCEXT extracts AR and RC of order P from Matrix MX
549  function  [AR,RC] = arcext(MX,P);
550
551   INPUT:
552  MX     AR and RC matrix calculated by durlev 
553  P      model order (default maximum possible)
554
555   OUTPUT
556  AR    autoregressive model parameter   
557  RC    reflection coefficients (= -PARCOR coefficients)
558
559  All input and output parameters are organized in rows, one row 
560  corresponds to the parameters of one channel
561
562  see also ACOVF ACORF DURLEV 
563  
564  REFERENCES:
565   P.J. Brockwell and R. A. Davis "Time Series: Theory and Methods", 2nd ed. Springer, 1991.
566   S. Haykin "Adaptive Filter Theory" 3rd ed. Prentice Hall, 1996.
567   M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. 
568   W.S. Wei "Time Series Analysis" Addison Wesley, 1990.
569
570
571
572 # name: <cell-element>
573 # type: sq_string
574 # elements: 1
575 # length: 80
576  ARCEXT extracts AR and RC of order P from Matrix MX
577  function  [AR,RC] = arcext
578
579
580
581 # name: <cell-element>
582 # type: sq_string
583 # elements: 1
584 # length: 6
585 arfit2
586
587
588 # name: <cell-element>
589 # type: sq_string
590 # elements: 1
591 # length: 1227
592  ARFIT2 estimates multivariate autoregressive parameters
593  of the MVAR process Y
594
595    Y(t,:)' = w' + A1*Y(t-1,:)' + ... + Ap*Y(t-p,:)' + x(t,:)'
596
597  ARFIT2 uses the Nutall-Strand method (multivariate Burg algorithm) 
598  which provides better estimates the ARFIT [1], and uses the 
599  same arguments. Moreover, ARFIT2 is faster and can deal with 
600  missing values encoded as NaNs. 
601
602  [w, A, C, sbc, fpe] = arfit2(v, pmin, pmax, selector, no_const)
603
604  INPUT: 
605   v             data - each channel in a column
606   pmin, pmax    minimum and maximum model order
607   selector      'fpe' or 'sbc' [default] 
608   no_const      'zero' indicates no bias/offset need to be estimated 
609                 in this case is w = [0, 0, ..., 0]'; 
610
611  OUTPUT: 
612   w             mean of innovation noise
613   A             [A1,A2,...,Ap] MVAR estimates   
614   C             covariance matrix of innovation noise
615   sbc, fpe      criteria for model order selection 
616
617  see also: ARFIT, MVAR
618
619  REFERENCES:
620   [1] A. Schloegl, 2006, Comparison of Multivariate Autoregressive Estimators.
621        Signal processing, p. 2426-9.
622   [2] T. Schneider and A. Neumaier, 2001. 
623         Algorithm 808: ARFIT-a Matlab package for the estimation of parameters and eigenmodes 
624         of multivariate autoregressive models. ACM-Transactions on Mathematical Software. 27, (Mar.), 58-65.
625
626
627
628 # name: <cell-element>
629 # type: sq_string
630 # elements: 1
631 # length: 80
632  ARFIT2 estimates multivariate autoregressive parameters
633  of the MVAR process Y
634
635
636
637
638 # name: <cell-element>
639 # type: sq_string
640 # elements: 1
641 # length: 7
642 biacovf
643
644
645 # name: <cell-element>
646 # type: sq_string
647 # elements: 1
648 # length: 228
649  BiAutoCovariance function 
650  [BiACF] = biacovf(Z,N);
651
652  Input: Z    Signal
653                 N  # of coefficients
654  Output:        BIACF bi-autocorrelation function (joint cumulant 3rd order
655  Output:        ACF   covariance function (joint cumulant 2nd order)
656
657
658
659 # name: <cell-element>
660 # type: sq_string
661 # elements: 1
662 # length: 53
663  BiAutoCovariance function 
664  [BiACF] = biacovf(Z,N);
665
666
667
668
669 # name: <cell-element>
670 # type: sq_string
671 # elements: 1
672 # length: 7
673 bisdemo
674
675
676 # name: <cell-element>
677 # type: sq_string
678 # elements: 1
679 # length: 48
680  BISDEMO (script) Shows BISPECTRUM of eeg8s.mat
681
682
683
684 # name: <cell-element>
685 # type: sq_string
686 # elements: 1
687 # length: 44
688  BISDEMO (script) Shows BISPECTRUM of eeg8s.
689
690
691
692 # name: <cell-element>
693 # type: sq_string
694 # elements: 1
695 # length: 6
696 bispec
697
698
699 # name: <cell-element>
700 # type: sq_string
701 # elements: 1
702 # length: 382
703  Calculates Bispectrum 
704  [BISPEC] = bispec(Z,N);
705
706  Input: Z    Signal
707                 N  # of coefficients
708  Output:        BiACF  bi-autocorrelation function = 3rd order cumulant
709                 BISPEC Bi-spectrum 
710
711  Reference(s):
712  C.L. Nikias and A.P. Petropulu "Higher-Order Spectra Analysis" Prentice Hall, 1993.
713  M.B. Priestley, "Non-linear and Non-stationary Time series Analysis", Academic Press, London, 1988.
714
715
716
717 # name: <cell-element>
718 # type: sq_string
719 # elements: 1
720 # length: 49
721  Calculates Bispectrum 
722  [BISPEC] = bispec(Z,N);
723
724
725
726
727 # name: <cell-element>
728 # type: sq_string
729 # elements: 1
730 # length: 7
731 content
732
733
734 # name: <cell-element>
735 # type: sq_string
736 # elements: 1
737 # length: 1809
738  Time Series Analysis (Ver 3.10)
739  Schloegl A. (1996-2003,2008) Time Series Analysis - A Toolbox for the use with Matlab. 
740  WWW: http://hci.tugraz.at/~schloegl/matlab/tsa/
741
742         $Id: content.m 5090 2008-06-05 08:12:04Z schloegl $
743         Copyright (C) 1996-2003,2008 by Alois Schloegl <a.schloegl@ieee.org>
744
745   Time Series Analysis - a toolbox for the use with Matlab
746    aar          adaptive autoregressive estimator 
747    acovf       (*) Autocovariance function
748    acorf (acf)  (*) autocorrelation function    
749    pacf (*) partial autocorrelation function, includes signifcance test and confidence interval
750    parcor       (*) partial autocorrelation function
751    biacovf      biautocovariance function (3rd order cumulant)
752    bispec       Bi-spectrum 
753    durlev      (*) solves Yule-Walker equation - converts ACOVF into AR parameters
754    lattice     (*) calcultes AR parameters with lattice method
755    lpc          (*) calculates the prediction coefficients form a given time series
756    invest0      (*) a prior investigation (used by invest1)
757    invest1      (*) investigates signal (useful for 1st evaluation of the data)
758    selmo        (*) Select Order of Autoregressive model using different criteria
759    histo        (*) histogram
760    hup          (*) test Hurwitz polynomials
761    ucp          (*) test Unit Circle Polynomials   
762    y2res        (*) computes mean, variance, skewness, kurtosis, entropy, etc. from data series 
763    ar_spa       (*) spectral analysis based on the autoregressive model
764    detrend      (*) removes trend, can handle missing values, non-equidistant sampled data       
765    flix floating index, interpolates data for non-interger indices
766    quantiles   calculates quantiles 
767
768  Multivariate analysis (planned in future)
769    mvar multivariate (vector) autoregressive estimation 
770    mvfilter     multivariate filter
771    arfit2       provides compatibility to ARFIT [Schneider and Neumaier, 2001]
772
773
774
775 # name: <cell-element>
776 # type: sq_string
777 # elements: 1
778 # length: 29
779  Time Series Analysis (Ver 3.
780
781
782
783 # name: <cell-element>
784 # type: sq_string
785 # elements: 1
786 # length: 8
787 contents
788
789
790 # name: <cell-element>
791 # type: sq_string
792 # elements: 1
793 # length: 5874
794  Time Series Analysis - A toolbox for the use with Matlab and Octave. 
795
796  $Id: contents.m 5090 2008-06-05 08:12:04Z schloegl $
797  Copyright (C) 1996-2004,2008 by Alois Schloegl <a.schloegl@ieee.org>
798  WWW: http://hci.tugraz.at/~schloegl/matlab/tsa/
799
800     This program is free software: you can redistribute it and/or modify
801     it under the terms of the GNU General Public License as published by
802     the Free Software Foundation, either version 3 of the License, or
803     (at your option) any later version.
804
805     This program is distributed in the hope that it will be useful,
806     but WITHOUT ANY WARRANTY; without even the implied warranty of
807     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
808     GNU General Public License for more details.
809
810     You should have received a copy of the GNU General Public License
811     along with this program.  If not, see <http://www.gnu.org/licenses/>.
812  
813
814   Time Series Analysis - a toolbox for the use with Matlab
815    aar          adaptive autoregressive estimator 
816    acovf       (*) Autocovariance function
817    acorf (acf)  (*) autocorrelation function    
818    pacf (*) partial autocorrelation function, includes signifcance test and confidence interval
819    parcor       (*) partial autocorrelation function
820    biacovf      biautocovariance function (3rd order cumulant)
821    bispec       Bi-spectrum 
822    durlev      (*) solves Yule-Walker equation - converts ACOVF into AR parameters
823    lattice     (*) calcultes AR parameters with lattice method
824    lpc          (*) calculates the prediction coefficients form a given time series
825    invest0      (*) a prior investigation (used by invest1)
826    invest1      (*) investigates signal (useful for 1st evaluation of the data)
827    rmle        AR estimation using recursive maximum likelihood function 
828    selmo        (*) Select Order of Autoregressive model using different criteria
829    histo        (*) histogram
830    hup          (*) test Hurwitz polynomials
831    ucp          (*) test Unit Circle Polynomials   
832    y2res        (*) computes mean, variance, skewness, kurtosis, entropy, etc. from data series 
833    ar_spa       (*) spectral analysis based on the autoregressive model
834    detrend      (*) removes trend, can handle missing values, non-equidistant sampled data       
835    flix floating index, interpolates data for non-interger indices
836
837
838  Multivariate analysis 
839    adim adaptive information matrix (inverse correlation matrix) 
840    mvar multivariate (vector) autoregressive estimation 
841    mvaar       multivariate adaptvie autoregressive estimation using Kalman filtering
842    mvfilter     multivariate filter
843    mvfreqz      multivariate spectra    
844    arfit2       provides compatibility to ARFIT [Schneider and Neumaier, 2001]
845
846         
847   Conversions between Autocorrelation (AC), Autoregressive parameters (AR), 
848                 prediction polynom (POLY) and Reflection coefficient (RC)  
849    ac2poly      (*) transforms autocorrelation into prediction polynom
850    ac2rc        (*) transforms autocorrelation into reflexion coefficients
851    ar2rc        (*) transforms autoregressive parameters into reflection coefficients  
852    rc2ar        (*) transforms reflection coefficients into autoregressive parameters
853    poly2ac      (*) transforms polynom to autocorrelation
854    poly2ar      (*) transforms polynom to AR 
855    poly2rc      (*) 
856    rc2ac        (*) 
857    rc2poly      (*) 
858    ar2poly      (*) 
859    
860  Utility functions 
861    sinvest1     shows the parameter calculated by INVEST1
862
863  Test suites
864    tsademo              demonstrates INVEST1 on EEG data
865    invfdemo             demonstration of matched, inverse filtering
866    bisdemo              demonstrates bispectral estimation
867
868  (*) indicates univariate analysis of multiple data series (each in a row) can be processed.
869  (-) indicates that these functions will be removed in future 
870
871  REFERENCES (sources):
872   http://www.itl.nist.gov/
873   http://mathworld.wolfram.com/
874   P.J. Brockwell and R.A. Davis "Time Series: Theory and Methods", 2nd ed. Springer, 1991.
875   O.   Foellinger "Lineare Abtastsysteme", Oldenburg Verlag, Muenchen, 1986.
876   F.   Gausch "Systemtechnik", Textbook, University of Technology Graz, 1993. 
877   M.S. Grewal and A.P. Andrews "Kalman Filtering" Prentice Hall, 1993. 
878   S.   Haykin "Adaptive Filter Theory" 3ed. Prentice Hall, 1996.
879   E.I. Jury "Theory and Application of the z-Transform Method", Robert E. Krieger Publishing Co., 1973. 
880   M.S. Kay "Modern Spectal Estimation" Prentice Hall, 1988. 
881   Ch.  Langraf and G. Schneider "Elemente der Regeltechnik", Springer Verlag, 1970.
882   S.L. Marple "Digital Spetral Analysis with Applications" Prentice Hall, 1987.
883   C.L. Nikias and A.P. Petropulu "Higher-Order Spectra Analysis" Prentice Hall, 1993.
884   M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. 
885   T. Schneider and A. Neumaier "Algorithm 808: ARFIT - a matlab package for the estimation of parameters and eigenmodes of multivariate autoregressive models" 
886                ACM Transactions on Mathematical software, 27(Mar), 58-65.
887   C.E. Shannon and W. Weaver "The mathematical theory of communication" University of Illinois Press, Urbana 1949 (reprint 1963).
888   W.S. Wei "Time Series Analysis" Addison Wesley, 1990.
889  
890  
891  REFERENCES (applications):
892  [1] A. Schlögl, B. Kemp, T. Penzel, D. Kunz, S.-L. Himanen,A. Värri, G. Dorffner, G. Pfurtscheller.
893      Quality Control of polysomnographic Sleep Data by Histogram and Entropy Analysis. 
894      Clin. Neurophysiol. 1999, Dec; 110(12): 2165 - 2170.
895  [2] Penzel T, Kemp B, Klösch G, Schlögl A, Hasan J, Varri A, Korhonen I.
896      Acquisition of biomedical signals databases
897      IEEE Engineering in Medicine and Biology Magazine 2001, 20(3): 25-32
898  [3] Alois Schlögl (2000)
899      The electroencephalogram and the adaptive autoregressive model: theory and applications
900      Shaker Verlag, Aachen, Germany,(ISBN3-8265-7640-3). 
901
902  Features:
903  - Multiple Signal Processing
904  - Efficient algorithms 
905  - Model order selection tools
906  - higher (3rd) order analysis
907  - Maximum entropy spectral estimation
908  - can deal with missing values (NaN's)
909
910
911
912 # name: <cell-element>
913 # type: sq_string
914 # elements: 1
915 # length: 69
916  Time Series Analysis - A toolbox for the use with Matlab and Octave.
917
918
919
920 # name: <cell-element>
921 # type: sq_string
922 # elements: 1
923 # length: 4
924 covm
925
926
927 # name: <cell-element>
928 # type: sq_string
929 # elements: 1
930 # length: 1182
931  COVM generates covariance matrix
932  X and Y can contain missing values encoded with NaN.
933  NaN's are skipped, NaN do not result in a NaN output. 
934  The output gives NaN only if there are insufficient input data
935
936  COVM(X,Mode);
937       calculates the (auto-)correlation matrix of X
938  COVM(X,Y,Mode);
939       calculates the crosscorrelation between X and Y
940  COVM(...,W);
941         weighted crosscorrelation 
942
943  Mode = 'M' minimum or standard mode [default]
944         C = X'*X; or X'*Y correlation matrix
945
946  Mode = 'E' extended mode
947         C = [1 X]'*[1 X]; % l is a matching column of 1's
948         C is additive, i.e. it can be applied to subsequent blocks and summed up afterwards
949         the mean (or sum) is stored on the 1st row and column of C
950
951  Mode = 'D' or 'D0' detrended mode
952         the mean of X (and Y) is removed. If combined with extended mode (Mode='DE'), 
953         the mean (or sum) is stored in the 1st row and column of C. 
954         The default scaling is factor (N-1). 
955  Mode = 'D1' is the same as 'D' but uses N for scaling. 
956
957  C = covm(...); 
958         C is the scaled by N in Mode M and by (N-1) in mode D.
959  [C,N] = covm(...);
960         C is not scaled, provides the scaling factor N  
961         C./N gives the scaled version. 
962
963  see also: DECOVM, XCOVF
964
965
966
967 # name: <cell-element>
968 # type: sq_string
969 # elements: 1
970 # length: 80
971  COVM generates covariance matrix
972  X and Y can contain missing values encoded wi
973
974
975
976 # name: <cell-element>
977 # type: sq_string
978 # elements: 1
979 # length: 7
980 detrend
981
982
983 # name: <cell-element>
984 # type: sq_string
985 # elements: 1
986 # length: 837
987  DETREND removes the trend from data, NaN's are considered as missing values
988  
989  DETREND is fully compatible to previous Matlab and Octave DETREND with the following features added:
990  - handles NaN's by assuming that these are missing values
991  - handles unequally spaced data
992  - second output parameter gives the trend of the data
993  - compatible to Matlab and Octave 
994
995  [...]=detrend([t,] X [,p])
996         removes trend for unequally spaced data
997         t represents the time points
998         X(i) is the value at time t(i)
999         p must be a scalar
1000
1001  [...]=detrend(X,0)
1002  [...]=detrend(X,'constant')
1003         removes the mean
1004
1005  [...]=detrend(X,p)
1006         removes polynomial of order p (default p=1)
1007
1008  [...]=detrend(X,1) - default
1009  [...]=detrend(X,'linear')
1010         removes linear trend 
1011
1012  [X,T]=detrend(...) 
1013
1014  X is the detrended data
1015  T is the removed trend
1016  
1017  see also: SUMSKIPNAN, ZSCORE           
1018
1019
1020
1021 # name: <cell-element>
1022 # type: sq_string
1023 # elements: 1
1024 # length: 80
1025  DETREND removes the trend from data, NaN's are considered as missing values
1026  
1027  
1028
1029
1030
1031 # name: <cell-element>
1032 # type: sq_string
1033 # elements: 1
1034 # length: 6
1035 durlev
1036
1037
1038 # name: <cell-element>
1039 # type: sq_string
1040 # elements: 1
1041 # length: 1241
1042  function  [AR,RC,PE] = durlev(ACF);
1043  function  [MX,PE] = durlev(ACF);
1044  estimates AR(p) model parameter by solving the
1045  Yule-Walker with the Durbin-Levinson recursion
1046  for multiple channels
1047   INPUT:
1048  ACF    Autocorrelation function from lag=[0:p]
1049
1050   OUTPUT
1051  AR    autoregressive model parameter   
1052  RC    reflection coefficients (= -PARCOR coefficients)
1053  PE    remaining error variance
1054  MX    transformation matrix between ARP and RC (Attention: needs O(p^2) memory)
1055         AR(:,K) = MX(:,K*(K-1)/2+(1:K));
1056         RC(:,K) = MX(:,(1:K).*(2:K+1)/2);
1057
1058  All input and output parameters are organized in rows, one row 
1059  corresponds to the parameters of one channel
1060
1061  see also ACOVF ACORF AR2RC RC2AR LATTICE
1062  
1063  REFERENCES:
1064   Levinson N. (1947) "The Wiener RMS(root-mean-square) error criterion in filter design and prediction." J. Math. Phys., 25, pp.261-278.
1065   Durbin J. (1960) "The fitting of time series models." Rev. Int. Stat. Inst. vol 28., pp 233-244.
1066   P.J. Brockwell and R. A. Davis "Time Series: Theory and Methods", 2nd ed. Springer, 1991.
1067   S. Haykin "Adaptive Filter Theory" 3rd ed. Prentice Hall, 1996.
1068   M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. 
1069   W.S. Wei "Time Series Analysis" Addison Wesley, 1990.
1070
1071
1072
1073 # name: <cell-element>
1074 # type: sq_string
1075 # elements: 1
1076 # length: 80
1077  function  [AR,RC,PE] = durlev(ACF);
1078  function  [MX,PE] = durlev(ACF);
1079  estimate
1080
1081
1082
1083 # name: <cell-element>
1084 # type: sq_string
1085 # elements: 1
1086 # length: 24
1087 flag_implicit_samplerate
1088
1089
1090 # name: <cell-element>
1091 # type: sq_string
1092 # elements: 1
1093 # length: 135
1094  The use of FLAG_IMPLICIT_SAMPLERATE is in experimental state. 
1095  FLAG_IMPLICIT_SAMPLERATE might even become obsolete.
1096  Do not use it. 
1097
1098
1099
1100 # name: <cell-element>
1101 # type: sq_string
1102 # elements: 1
1103 # length: 62
1104  The use of FLAG_IMPLICIT_SAMPLERATE is in experimental state.
1105
1106
1107
1108 # name: <cell-element>
1109 # type: sq_string
1110 # elements: 1
1111 # length: 22
1112 flag_implicit_skip_nan
1113
1114
1115 # name: <cell-element>
1116 # type: sq_string
1117 # elements: 1
1118 # length: 934
1119  FLAG_IMPLICIT_SKIP_NAN sets and gets default mode for handling NaNs
1120         1 skips NaN's (the default mode if no mode is set)
1121         0 NaNs are propagated; input NaN's give NaN's at the output
1122  
1123  FLAG = flag_implicit_skip_nan()
1124         gets current mode
1125
1126  flag_implicit_skip_nan(FLAG)
1127  sets mode 
1128
1129  prevFLAG = flag_implicit_skip_nan(nextFLAG)
1130         gets previous set FLAG and sets FLAG for the future
1131  flag_implicit_skip_nan(prevFLAG)
1132         resets FLAG to previous mode
1133
1134  It is used in: 
1135         SUMSKIPNAN, MEDIAN, QUANTILES, TRIMEAN
1136  and affects many other functions like: 
1137         CENTER, KURTOSIS, MAD, MEAN, MOMENT, RMS, SEM, SKEWNESS, 
1138         STATISTIC, STD, VAR, ZSCORE etc. 
1139
1140  The mode is stored in the global variable FLAG_implicit_skip_nan
1141  It is recommended to use flag_implicit_skip_nan(1) as default and
1142  flag_implicit_skip_nan(0) should be used for exceptional cases only.
1143  This feature might disappear without further notice, so you should really not
1144  rely on it. 
1145
1146
1147
1148 # name: <cell-element>
1149 # type: sq_string
1150 # elements: 1
1151 # length: 80
1152  FLAG_IMPLICIT_SKIP_NAN sets and gets default mode for handling NaNs
1153         1 skips Na
1154
1155
1156
1157 # name: <cell-element>
1158 # type: sq_string
1159 # elements: 1
1160 # length: 4
1161 flix
1162
1163
1164 # name: <cell-element>
1165 # type: sq_string
1166 # elements: 1
1167 # length: 603
1168  floating point index - interpolates data in case of non-integer indices
1169
1170  Y=flix(D,x)
1171    FLIX returns Y=D(x) if x is an integer 
1172    otherwise D(x) is interpolated from the neighbors D(ceil(x)) and D(floor(x)) 
1173  
1174  Applications: 
1175  (1)  discrete Dataseries can be upsampled to higher sampling rate   
1176  (2)  transformation of non-equidistant samples to equidistant samples
1177  (3)  [Q]=flix(sort(D),q*(length(D)+1)) calculates the q-quantile of data series D   
1178
1179  FLIX(D,x) is the same as INTERP1(D,X,'linear'); Therefore, FLIX might
1180  become obsolete in future. 
1181
1182  see also: HIST2RES, Y2RES, PLOTCDF, INTERP1
1183
1184
1185
1186 # name: <cell-element>
1187 # type: sq_string
1188 # elements: 1
1189 # length: 73
1190  floating point index - interpolates data in case of non-integer indices
1191
1192
1193
1194
1195 # name: <cell-element>
1196 # type: sq_string
1197 # elements: 1
1198 # length: 5
1199 histo
1200
1201
1202 # name: <cell-element>
1203 # type: sq_string
1204 # elements: 1
1205 # length: 581
1206  HISTO calculates histogram for each column
1207  [H,X] = HISTO(Y,Mode)
1208            
1209    Mode 
1210         'rows' : frequency of each row
1211         '1x'   : single bin-values 
1212         'nx'   : separate bin-values for each column
1213    X  are the bin-values 
1214    H  is the frequency of occurence of value X 
1215
1216  HISTO(Y) with no output arguments:
1217         plots the histogram bar(X,H)
1218
1219  more histogram-based results can be obtained by HIST2RES2  
1220
1221  see also:  HISTO, HISTO2, HISTO3, HISTO4
1222
1223  REFERENCE(S):
1224   C.E. Shannon and W. Weaver "The mathematical theory of communication" University of Illinois Press, Urbana 1949 (reprint 1963).
1225
1226
1227
1228 # name: <cell-element>
1229 # type: sq_string
1230 # elements: 1
1231 # length: 80
1232  HISTO calculates histogram for each column
1233  [H,X] = HISTO(Y,Mode)
1234            
1235    Mode
1236
1237
1238
1239 # name: <cell-element>
1240 # type: sq_string
1241 # elements: 1
1242 # length: 6
1243 histo2
1244
1245
1246 # name: <cell-element>
1247 # type: sq_string
1248 # elements: 1
1249 # length: 1009
1250  HISTO2 calculates histogram for multiple columns with separate bin values 
1251     for each data column.
1252
1253  R = HISTO2(Y)
1254  R = HISTO2(Y, W)
1255         Y       data
1256         W       weight vector containing weights of each sample, 
1257                 number of rows of Y and W must match.
1258                 default W=[] indicates that each sample is weighted with 1. 
1259
1260  R = HISTO(...)            
1261         R is    a struct with th fields 
1262        R.X      the bin-values, bin-values are computed separately for each 
1263                 data column, thus R.X is a matrix, each column contains the 
1264                 the bin values of for each data column, unused elements are indicated with NaN.
1265                 In order to have common bin values, use HISTO3.  
1266        R.H  is the frequency of occurence of value X 
1267         R.N  are the number of valid (not NaN) samples (i.e. sum of weights)
1268
1269  more histogram-based results can be obtained by HIST2RES2  
1270
1271  see also: HISTO, HISTO2, HISTO3, HISTO4
1272
1273  REFERENCE(S):
1274   C.E. Shannon and W. Weaver "The mathematical theory of communication" University of Illinois Press, Urbana 1949 (reprint 1963).
1275
1276
1277
1278 # name: <cell-element>
1279 # type: sq_string
1280 # elements: 1
1281 # length: 80
1282  HISTO2 calculates histogram for multiple columns with separate bin values 
1283     
1284
1285
1286
1287 # name: <cell-element>
1288 # type: sq_string
1289 # elements: 1
1290 # length: 6
1291 histo3
1292
1293
1294 # name: <cell-element>
1295 # type: sq_string
1296 # elements: 1
1297 # length: 1266
1298  HISTO3 calculates histogram for multiple columns with common bin values 
1299     among all data columns, and can be useful for data compression. 
1300
1301  R = HISTO3(Y)
1302  R = HISTO3(Y, W)
1303         Y       data
1304         W       weight vector containing weights of each sample, 
1305                 number of rows of Y and W must match.
1306                 default W=[] indicates that each sample is weighted with 1. 
1307         R       struct with these fields 
1308        R.X      the bin-values, bin-values are equal for each channel
1309                 thus R.X is a column vector. If bin values should 
1310                 be computed separately for each data column, use HISTO2
1311        R.H      is the frequency of occurence of value X 
1312         R.N     are the number of valid (not NaN) samples 
1313
1314  Data compression can be performed in this way
1315         [R,tix] = histo3(Y) 
1316                 is the compression step
1317
1318         R.tix provides a compressed data representation. 
1319         R.compressionratio estimates the compression ratio
1320
1321         R.X(tix) and R.X(R.tix) 
1322                 reconstruct the orginal signal (decompression) 
1323
1324  The effort (in memory and speed) for compression is O(n*log(n)).
1325  The effort (in memory and speed) for decompression is O(n) only. 
1326
1327  see also: HISTO, HISTO2, HISTO3, HISTO4
1328
1329  REFERENCE(S):
1330   C.E. Shannon and W. Weaver "The mathematical theory of communication" University of Illinois Press, Urbana 1949 (reprint 1963).
1331
1332
1333
1334 # name: <cell-element>
1335 # type: sq_string
1336 # elements: 1
1337 # length: 80
1338  HISTO3 calculates histogram for multiple columns with common bin values 
1339     am
1340
1341
1342
1343 # name: <cell-element>
1344 # type: sq_string
1345 # elements: 1
1346 # length: 6
1347 histo4
1348
1349
1350 # name: <cell-element>
1351 # type: sq_string
1352 # elements: 1
1353 # length: 965
1354  HISTO4 calculates histogram of multidimensional data samples 
1355    and supports data compression
1356
1357  R = HISTO4(Y)
1358  R = HISTO4(Y, W)
1359         Y    data: on sample per row, each sample has with size(Y,2) elements 
1360         W    weights of each sample (default: [])
1361              W = [] indicates that each sample has equal weight 
1362         R is a struct with these fields: 
1363        R.X  are the bin-values 
1364        R.H  is the frequency of occurence of value X (weighted with W)
1365         R.N  are the total number of samples (or sum of W)
1366
1367  HISTO4 might be useful for data compression, because
1368  [R,tix] = histo4(Y) 
1369         is the compression step
1370  R.X(tix,:) 
1371         is the decompression step
1372
1373  The effort (in memory and speed) for compression is O(n*log(n))
1374  The effort (in memory and speed) for decompression is only O(n)
1375  
1376  see also: HISTO, HISTO2, HISTO3, HISTO4
1377
1378  REFERENCE(S):
1379   C.E. Shannon and W. Weaver 'The mathematical theory of communication' University of Illinois Press, Urbana 1949 (reprint 1963).
1380
1381
1382
1383 # name: <cell-element>
1384 # type: sq_string
1385 # elements: 1
1386 # length: 80
1387  HISTO4 calculates histogram of multidimensional data samples 
1388    and supports d
1389
1390
1391
1392 # name: <cell-element>
1393 # type: sq_string
1394 # elements: 1
1395 # length: 3
1396 hup
1397
1398
1399 # name: <cell-element>
1400 # type: sq_string
1401 # elements: 1
1402 # length: 588
1403 HUP(C)  tests if the polynomial C is a Hurwitz-Polynomial.
1404         It tests if all roots lie in the left half of the complex
1405         plane 
1406        B=hup(C) is the same as 
1407        B=all(real(roots(c))<0) but much faster.
1408         The Algorithm is based on the Routh-Scheme.
1409         C are the elements of the Polynomial
1410         C(1)*X^N + ... + C(N)*X + C(N+1).
1411
1412        HUP2 works also for multiple polynomials, 
1413        each row a poly - Yet not tested
1414
1415  REFERENCES:
1416   F. Gausch "Systemtechnik", Textbook, University of Technology Graz, 1993. 
1417   Ch. Langraf and G. Schneider "Elemente der Regeltechnik", Springer Verlag, 1970.
1418
1419
1420
1421 # name: <cell-element>
1422 # type: sq_string
1423 # elements: 1
1424 # length: 57
1425 HUP(C)  tests if the polynomial C is a Hurwitz-Polynomial.
1426
1427
1428
1429 # name: <cell-element>
1430 # type: sq_string
1431 # elements: 1
1432 # length: 7
1433 invest0
1434
1435
1436 # name: <cell-element>
1437 # type: sq_string
1438 # elements: 1
1439 # length: 842
1440  First Investigation of a signal (time series) - automated part
1441  [AutoCov,AutoCorr,ARPMX,E,ACFsd,NC]=invest0(Y,Pmax);
1442
1443  [AutoCov,AutoCorr,ARPMX,E,ACFsd,NC]=invest0(AutoCov,Pmax,Mode);
1444  
1445
1446  Y      time series
1447  Pmax   maximal order (optional)
1448
1449  AutoCov        Autocorrelation 
1450  AutoCorr       normalized Autocorrelation
1451  PartACF        Partial Autocorrelation
1452  ARPMX     Autoregressive Parameter for order Pmax-1
1453  E              Error function E(p)
1454  NC            Number of values (length-missing values)
1455
1456  REFERENCES:
1457   P.J. Brockwell and R.A. Davis "Time Series: Theory and Methods", 2nd ed. Springer, 1991.
1458   M.S. Grewal and A.P. Andrews "Kalman Filtering" Prentice Hall, 1993. 
1459   S. Haykin "Adaptive Filter Theory" 3ed. Prentice Hall, 1996.
1460   M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. 
1461   W.S. Wei "Time Series Analysis" Addison Wesley, 1990.
1462
1463
1464
1465 # name: <cell-element>
1466 # type: sq_string
1467 # elements: 1
1468 # length: 80
1469  First Investigation of a signal (time series) - automated part
1470  [AutoCov,AutoCo
1471
1472
1473
1474 # name: <cell-element>
1475 # type: sq_string
1476 # elements: 1
1477 # length: 7
1478 invest1
1479
1480
1481 # name: <cell-element>
1482 # type: sq_string
1483 # elements: 1
1484 # length: 1306
1485  First Investigation of a signal (time series) - interactive
1486  [AutoCov,AutoCorr,ARPMX,E,CRITERIA,MOPS]=invest1(Y,Pmax,show);
1487
1488  Y      time series
1489  Pmax   maximal order (optional)
1490  show  optional; if given the parameters are shown
1491
1492  AutoCov        Autocorrelation 
1493  AutoCorr       normalized Autocorrelation
1494  PartACF        Partial Autocorrelation
1495  E      Error function E(p)
1496  CRITERIA curves of the various (see below) criteria, 
1497  MOPS=[optFPE optAIC optBIC optSBC optMDL optCAT optPHI];
1498       optimal model order according to various criteria
1499
1500  FPE    Final Prediction Error (Kay, 1987)
1501  AIC    Akaike Information Criterion (Marple, 1987)
1502  BIC    Bayesian Akaike Information Criterion (Wei, 1994)
1503  SBC    Schwartz's Bayesian Criterion (Wei, 1994)
1504  MDL    Minimal Description length Criterion (Marple, 1987)
1505  CAT    Parzen's CAT Criterion (Wei, 1994)
1506  PHI    Phi criterion (Pukkila et al. 1988)
1507  minE           order where E is minimal
1508
1509  REFERENCES:
1510   P.J. Brockwell and R.A. Davis "Time Series: Theory and Methods", 2nd ed. Springer, 1991.
1511   S.   Haykin "Adaptive Filter Theory" 3ed. Prentice Hall, 1996.
1512   M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. 
1513   C.E. Shannon and W. Weaver "The mathematical theory of communication" University of Illinois Press, Urbana 1949 (reprint 1963).
1514   W.S. Wei "Time Series Analysis" Addison Wesley, 1990.
1515
1516
1517
1518 # name: <cell-element>
1519 # type: sq_string
1520 # elements: 1
1521 # length: 80
1522  First Investigation of a signal (time series) - interactive
1523  [AutoCov,AutoCorr,
1524
1525
1526
1527 # name: <cell-element>
1528 # type: sq_string
1529 # elements: 1
1530 # length: 8
1531 invfdemo
1532
1533
1534 # name: <cell-element>
1535 # type: sq_string
1536 # elements: 1
1537 # length: 41
1538  invfdemo       demonstrates Inverse Filtering
1539
1540
1541
1542 # name: <cell-element>
1543 # type: sq_string
1544 # elements: 1
1545 # length: 41
1546  invfdemo       demonstrates Inverse Filtering
1547
1548
1549
1550
1551 # name: <cell-element>
1552 # type: sq_string
1553 # elements: 1
1554 # length: 7
1555 lattice
1556
1557
1558 # name: <cell-element>
1559 # type: sq_string
1560 # elements: 1
1561 # length: 1531
1562  Estimates AR(p) model parameter with lattice algorithm (Burg 1968) 
1563  for multiple channels. 
1564  If you have the NaN-tools, LATTICE.M can handle missing values (NaN), 
1565
1566  [...] = lattice(y [,Pmax [,Mode]]);
1567
1568  [AR,RC,PE] = lattice(...);
1569  [MX,PE] = lattice(...);
1570
1571   INPUT:
1572  y      signal (one per row), can contain missing values (encoded as NaN)
1573  Pmax   max. model order (default size(y,2)-1))
1574  Mode  'BURG' (default) Burg algorithm
1575         'GEOL' geometric lattice
1576
1577   OUTPUT
1578  AR    autoregressive model parameter   
1579  RC    reflection coefficients (= -PARCOR coefficients)
1580  PE    remaining error variance
1581  MX    transformation matrix between ARP and RC (Attention: needs O(p^2) memory)
1582         AR(:,K) = MX(:, K*(K-1)/2+(1:K)); = MX(:,sum(1:K-1)+(1:K)); 
1583         RC(:,K) = MX(:,cumsum(1:K));      = MX(:,(1:K).*(2:K+1)/2);
1584
1585  All input and output parameters are organized in rows, one row 
1586  corresponds to the parameters of one channel
1587
1588  see also ACOVF ACORF AR2RC RC2AR DURLEV SUMSKIPNAN 
1589  
1590  REFERENCE(S):
1591   J.P. Burg, "Maximum Entropy Spectral Analysis" Proc. 37th Meeting of the Society of Exp. Geophysiscists, Oklahoma City, OK 1967
1592   J.P. Burg, "Maximum Entropy Spectral Analysis" PhD-thesis, Dept. of Geophysics, Stanford University, Stanford, CA. 1975.
1593   P.J. Brockwell and R. A. Davis "Time Series: Theory and Methods", 2nd ed. Springer, 1991.
1594   S.   Haykin "Adaptive Filter Theory" 3rd ed. Prentice Hall, 1996.
1595   M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. 
1596   W.S. Wei "Time Series Analysis" Addison Wesley, 1990.
1597
1598
1599
1600 # name: <cell-element>
1601 # type: sq_string
1602 # elements: 1
1603 # length: 80
1604  Estimates AR(p) model parameter with lattice algorithm (Burg 1968) 
1605  for multip
1606
1607
1608
1609 # name: <cell-element>
1610 # type: sq_string
1611 # elements: 1
1612 # length: 3
1613 lpc
1614
1615
1616 # name: <cell-element>
1617 # type: sq_string
1618 # elements: 1
1619 # length: 759
1620  LPC Linear prediction coefficients 
1621  The Burg-method is used to estimate the prediction coefficients
1622
1623  A = lpc(Y [,P]) finds the coefficients  A=[ 1 A(2) ... A(N+1) ],
1624         of an Pth order forward linear predictor
1625      
1626          Xp(n) = -A(2)*X(n-1) - A(3)*X(n-2) - ... - A(N+1)*X(n-P)
1627             
1628         such that the sum of the squares of the errors
1629                 
1630        err(n) = X(n) - Xp(n)
1631                
1632         is minimized.  X can be a vector or a matrix.  If X is a matrix
1633        containing a separate signal in each column, LPC returns a model
1634         estimate for each column in the rows of A. N specifies the order
1635         of the polynomial A(z).
1636                                        
1637         If you do not specify a value for P, LPC uses a default P = length(X)-1.
1638
1639
1640  see also ACOVF ACORF AR2POLY RC2AR DURLEV SUMSKIPNAN LATTICE 
1641  
1642
1643
1644
1645 # name: <cell-element>
1646 # type: sq_string
1647 # elements: 1
1648 # length: 80
1649  LPC Linear prediction coefficients 
1650  The Burg-method is used to estimate the pr
1651
1652
1653
1654 # name: <cell-element>
1655 # type: sq_string
1656 # elements: 1
1657 # length: 5
1658 mvaar
1659
1660
1661 # name: <cell-element>
1662 # type: sq_string
1663 # elements: 1
1664 # length: 784
1665  Multivariate (Vector) adaptive AR estimation base on a multidimensional
1666  Kalman filer algorithm. A standard VAR model (A0=I) is implemented. The 
1667  state vector is defined as X=(A1|A2...|Ap) and x=vec(X')
1668
1669  [x,e,Kalman,Q2] = mvaar(y,p,UC,mode,Kalman)
1670
1671  The standard MVAR model is defined as:
1672
1673                 y(n)-A1(n)*y(n-1)-...-Ap(n)*y(n-p)=e(n)
1674
1675         The dimension of y(n) equals s 
1676         
1677         Input Parameters:
1678
1679                 y                       Observed data or signal 
1680                 p                       prescribed maximum model order (default 1)
1681                 UC                      update coefficient      (default 0.001)
1682                 mode            update method of the process noise covariance matrix 0...4 ^
1683                                         correspond to S0...S4 (default 0)
1684
1685         Output Parameters
1686
1687                 e                       prediction error of dimension s
1688                 x                       state vector of dimension s*s*p
1689                 Q2                      measurement noise covariance matrix of dimension s x s
1690
1691
1692
1693
1694 # name: <cell-element>
1695 # type: sq_string
1696 # elements: 1
1697 # length: 80
1698  Multivariate (Vector) adaptive AR estimation base on a multidimensional
1699  Kalman
1700
1701
1702
1703 # name: <cell-element>
1704 # type: sq_string
1705 # elements: 1
1706 # length: 4
1707 mvar
1708
1709
1710 # name: <cell-element>
1711 # type: sq_string
1712 # elements: 1
1713 # length: 3018
1714  MVAR estimates parameters of the Multi-Variate AutoRegressive model 
1715
1716     Y(t) = Y(t-1) * A1 + ... + Y(t-p) * Ap + X(t);  
1717  whereas
1718     Y(t) is a row vecter with M elements Y(t) = y(t,1:M) 
1719
1720  Several estimation algorithms are implemented, all estimators 
1721  can handle data with missing values encoded as NaNs.  
1722
1723         [AR,RC,PE] = mvar(Y, p);
1724         [AR,RC,PE] = mvar(Y, p, Mode);
1725  
1726  with 
1727        AR = [A1, ..., Ap];
1728
1729  INPUT:
1730   Y      Multivariate data series 
1731   p     Model order
1732   Mode   determines estimation algorithm 
1733
1734  OUTPUT:
1735   AR    multivariate autoregressive model parameter
1736   RC    reflection coefficients (= -PARCOR coefficients)
1737   PE    remaining error variances for increasing model order
1738            PE(:,p*M+[1:M]) is the residual variance for model order p
1739
1740  All input and output parameters are organized in columns, one column 
1741  corresponds to the parameters of one channel.
1742
1743  Mode determines estimation algorithm. 
1744   1:  Correlation Function Estimation method using biased correlation function estimation method
1745                 also called the 'multichannel Yule-Walker' [1,2] 
1746   6:  Correlation Function Estimation method using unbiased correlation function estimation method
1747
1748   2:  Partial Correlation Estimation: Vieira-Morf [2] using unbiased covariance estimates.
1749                In [1] this mode was used and (incorrectly) denominated as Nutall-Strand. 
1750                 Its the DEFAULT mode; according to [1] it provides the most accurate estimates.
1751   5:  Partial Correlation Estimation: Vieira-Morf [2] using biased covariance estimates.
1752                 Yields similar results than Mode=2;
1753
1754   3:  buggy: Partial Correlation Estimation: Nutall-Strand [2] (biased correlation function)
1755   9:  Partial Correlation Estimation: Nutall-Strand [2] (biased correlation function)
1756   7:  Partial Correlation Estimation: Nutall-Strand [2] (unbiased correlation function)
1757   8:  Least Squares w/o nans in Y(t):Y(t-p)
1758  10:  ARFIT [3] 
1759  11:  BURGV [4] 
1760  13:  modified BURGV -  
1761  14:  modified BURGV [4] 
1762  15:  Least Squares based on correlation matrix
1763  22: Modified Partial Correlation Estimation: Vieira-Morf [2,5] using unbiased covariance estimates.
1764  25: Modified Partial Correlation Estimation: Vieira-Morf [2,5] using biased covariance estimates.
1765
1766  90,91,96: Experimental versions 
1767
1768     Imputation methods:
1769   100+Mode: 
1770   200+Mode: forward, past missing values are assumed zero
1771   300+Mode: backward, past missing values are assumed zero
1772   400+Mode: forward+backward, past missing values are assumed zero
1773  1200+Mode: forward, past missing values are replaced with predicted value
1774  1300+Mode: backward, 'past' missing values are replaced with predicted value
1775  1400+Mode: forward+backward, 'past' missing values are replaced with predicted value
1776  2200+Mode: forward, past missing values are replaced with predicted value + noise to prevent decaying
1777  2300+Mode: backward, past missing values are replaced with predicted value + noise to prevent decaying
1778  2400+Mode: forward+backward, past missing values are replaced with predicted value + noise to prevent decaying
1779
1780
1781
1782
1783
1784
1785 # name: <cell-element>
1786 # type: sq_string
1787 # elements: 1
1788 # length: 70
1789  MVAR estimates parameters of the Multi-Variate AutoRegressive model 
1790
1791
1792
1793
1794 # name: <cell-element>
1795 # type: sq_string
1796 # elements: 1
1797 # length: 8
1798 mvfilter
1799
1800
1801 # name: <cell-element>
1802 # type: sq_string
1803 # elements: 1
1804 # length: 1028
1805  Multi-variate filter function
1806
1807  Y = MVFILTER(B,A,X)
1808  [Y,Z] = MVFILTER(B,A,X,Z)
1809
1810   Y = MVFILTER(B,A,X) filters the data in matrix X with the
1811     filter described by cell arrays A and B to create the filtered
1812     data Y.  The filter is a 'Direct Form II Transposed'
1813     implementation of the standard difference equation:
1814  
1815     a0*Y(n) = b0*X(:,n) + b1*X(:,n-1) + ... + bq*X(:,n-q)
1816                         - a1*Y(:,n-1) - ... - ap*Y(:,n-p)
1817
1818   A=[a0,a1,a2,...,ap] and B=[b0,b1,b2,...,bq] must be matrices of
1819   size  Mx((p+1)*M) and Mx((q+1)*M), respectively. 
1820   a0,a1,...,ap, b0,b1,...,bq are matrices of size MxM
1821   a0 is usually the identity matrix I or must be invertible 
1822   X should be of size MxN, if X has size NxM a warning 
1823   is raised, and the output Y is also transposed. 
1824
1825  A simulated MV-AR process can be generiated with 
1826         Y = mvfilter(eye(M), [eye(M),-AR],randn(M,N));
1827
1828  A multivariate inverse filter can be realized with 
1829        [AR,RC,PE] = mvar(Y,P);
1830         E = mvfilter([eye(M),-AR],eye(M),Y);
1831
1832  see also: MVAR, FILTER
1833
1834
1835
1836 # name: <cell-element>
1837 # type: sq_string
1838 # elements: 1
1839 # length: 31
1840  Multi-variate filter function
1841
1842
1843
1844
1845 # name: <cell-element>
1846 # type: sq_string
1847 # elements: 1
1848 # length: 7
1849 mvfreqz
1850
1851
1852 # name: <cell-element>
1853 # type: sq_string
1854 # elements: 1
1855 # length: 3844
1856  MVFREQZ multivariate frequency response
1857  [S,h,PDC,COH,DTF,DC,pCOH,dDTF,ffDTF,pCOH2,PDCF,coh,GGC,Af,GPDC] = mvfreqz(B,A,C,f,Fs)
1858  [...]  = mvfreqz(B,A,C,N,Fs)
1859   
1860  INPUT: 
1861  ======= 
1862  A, B   multivariate polynomials defining the transfer function
1863
1864     a0*Y(n) = b0*X(n) + b1*X(n-1) + ... + bq*X(n-q)
1865                           - a1*Y(n-1) - ... - ap*Y(:,n-p)
1866
1867   A=[a0,a1,a2,...,ap] and B=[b0,b1,b2,...,bq] must be matrices of
1868   size  Mx((p+1)*M) and Mx((q+1)*M), respectively. 
1869
1870   C is the covariance of the input noise X (i.e. D'*D if D is the mixing matrix)
1871   N if scalar, N is the number of frequencies 
1872     if N is a vector, N are the designated frequencies. 
1873   Fs sampling rate [default 2*pi]
1874  
1875   A,B,C and D can by obtained from a multivariate time series 
1876        through the following commands: 
1877   [AR,RC,PE] = mvar(Y,P);
1878        M = size(AR,1); % number of channels       
1879        A = [eye(M),-AR];
1880        B = eye(M); 
1881        C = PE(:,M*P+1:M*(P+1)); 
1882
1883  Fs     sampling rate in [Hz]
1884  (N     number of frequencies for computing the spectrum, this will become OBSOLETE),  
1885  f      vector of frequencies (in [Hz])  
1886
1887
1888  OUTPUT: 
1889  ======= 
1890  S      power spectrum
1891  h      transfer functions, abs(h.^2) is the non-normalized DTF [11]
1892  PDC    partial directed coherence [2]
1893  DC     directed coupling       
1894  COH    coherency (complex coherence) [5]
1895  DTF    directed transfer function
1896  pCOH   partial coherence
1897  dDTF   direct Directed Transfer function
1898  ffDTF full frequency Directed Transfer Function 
1899  pCOH2 partial coherence - alternative method 
1900  GGC    a modified version of Geweke's Granger Causality [Geweke 1982]
1901            !!! it uses a Multivariate AR model, and computes the bivariate GGC as in [Bressler et al 2007]. 
1902            This is not the same as using bivariate AR models and GGC as in [Bressler et al 2007]
1903  Af     Frequency transform of A(z), abs(Af.^2) is the non-normalized PDC [11]
1904  PDCF   Partial Directed Coherence Factor [2]
1905  GPDC   Generalized Partial Directed Coherence [9,10]
1906
1907  see also: FREQZ, MVFILTER, MVAR
1908  
1909  REFERENCE(S):
1910  [1] H. Liang et al. Neurocomputing, 32-33, pp.891-896, 2000. 
1911  [2] L.A. Baccala and K. Samashima, Biol. Cybern. 84,463-474, 2001. 
1912  [3] A. Korzeniewska, et al. Journal of Neuroscience Methods, 125, 195-207, 2003. 
1913  [4] Piotr J. Franaszczuk, Ph.D. and Gregory K. Bergey, M.D.
1914         Fast Algorithm for Computation of Partial Coherences From Vector Autoregressive Model Coefficients
1915         World Congress 2000, Chicago. 
1916  [5] Nolte G, Bai O, Wheaton L, Mari Z, Vorbach S, Hallett M.
1917         Identifying true brain interaction from EEG data using the imaginary part of coherency.
1918         Clin Neurophysiol. 2004 Oct;115(10):2292-307. 
1919  [6] Schlogl A., Supp G.
1920        Analyzing event-related EEG data with multivariate autoregressive parameters.
1921        (Eds.) C. Neuper and W. Klimesch, 
1922        Progress in Brain Research: Event-related Dynamics of Brain Oscillations. 
1923        Analysis of dynamics of brain oscillations: methodological advances. Elsevier. 
1924        Progress in Brain Research 159, 2006, p. 135 - 147
1925  [7] Bressler S.L., Richter C.G., Chen Y., Ding M. (2007)
1926         Cortical fuctional network organization from autoregressive modelling of loal field potential oscillations.
1927         Statistics in Medicine, doi: 10.1002/sim.2935 
1928  [8] Geweke J., 1982    
1929         J.Am.Stat.Assoc., 77, 304-313.
1930  [9] L.A. Baccala, D.Y. Takahashi, K. Sameshima. (2006) 
1931         Generalized Partial Directed Coherence. 
1932         Submitted to XVI Congresso Brasileiro de Automatica, Salvador, Bahia.  
1933  [10] L.A. Baccala, D.Y. Takahashi, K. Sameshima. 
1934         Computer Intensive Testing for the Influence Between Time Series, 
1935         Eds. B. Schelter, M. Winterhalder, J. Timmer: 
1936         Handbook of Time Series Analysis - Recent Theoretical Developments and Applications
1937         Wiley, p.413, 2006.
1938  [11] M. Eichler
1939         On the evaluation of informatino flow in multivariate systems by the directed transfer function
1940         Biol. Cybern. 94: 469-482, 2006.        
1941
1942
1943
1944 # name: <cell-element>
1945 # type: sq_string
1946 # elements: 1
1947 # length: 80
1948  MVFREQZ multivariate frequency response
1949  [S,h,PDC,COH,DTF,DC,pCOH,dDTF,ffDTF,pC
1950
1951
1952
1953 # name: <cell-element>
1954 # type: sq_string
1955 # elements: 1
1956 # length: 4
1957 pacf
1958
1959
1960 # name: <cell-element>
1961 # type: sq_string
1962 # elements: 1
1963 # length: 137
1964  Partial Autocorrelation function
1965  [parcor,sig,cil,ciu] = pacf(Z,N);
1966
1967  Input:
1968         Z    Signal, each row is analysed
1969         N    # of coefficients
1970
1971
1972
1973 # name: <cell-element>
1974 # type: sq_string
1975 # elements: 1
1976 # length: 69
1977  Partial Autocorrelation function
1978  [parcor,sig,cil,ciu] = pacf(Z,N);
1979
1980
1981
1982
1983 # name: <cell-element>
1984 # type: sq_string
1985 # elements: 1
1986 # length: 6
1987 parcor
1988
1989
1990 # name: <cell-element>
1991 # type: sq_string
1992 # elements: 1
1993 # length: 1160
1994  estimates partial autocorrelation coefficients 
1995  Multiple channels can be used (one per row).
1996
1997  [PARCOR, AR, PE] = parcor(AutoCov); % calculates Partial autocorrelation, autoregressive coefficients and residual error variance from the Autocorrelation function. 
1998
1999  [PARCOR] = parcor(acovf(x,p)); % calculates the Partial Autocorrelation coefficients of the data series x up to order p
2000
2001   INPUT:
2002  AutoCov        Autocorrelation function for lag=0:P
2003
2004   OUTPUT
2005  AR     autoregressive model parameter  
2006  PARCOR partial correlation coefficients (= -reflection coefficients)
2007  PE    remaining error variance
2008
2009  All input and output parameters are organized in rows, one row 
2010  corresponds to the parameters of one channel. 
2011  The PARCOR coefficients are the negative reflection coefficients. 
2012  A significance test is implemented in PACF.
2013
2014  see also: PACF ACOVF ACORF DURLEV AC2RC 
2015  
2016  REFERENCES:
2017   P.J. Brockwell and R.A. Davis "Time Series: Theory and Methods", 2nd ed. Springer, 1991.
2018   S. Haykin "Adaptive Filter Theory" 3ed. Prentice Hall, 1996.
2019   M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. 
2020   W.S. Wei "Time Series Analysis" Addison Wesley, 1990.
2021
2022
2023
2024 # name: <cell-element>
2025 # type: sq_string
2026 # elements: 1
2027 # length: 80
2028  estimates partial autocorrelation coefficients 
2029  Multiple channels can be used 
2030
2031
2032
2033 # name: <cell-element>
2034 # type: sq_string
2035 # elements: 1
2036 # length: 7
2037 poly2ac
2038
2039
2040 # name: <cell-element>
2041 # type: sq_string
2042 # elements: 1
2043 # length: 183
2044  converts an AR polynomial into an autocorrelation sequence
2045  [R] = poly2ac(a [,efinal] );
2046
2047  see also ACOVF ACORF AR2RC RC2AR DURLEV AC2POLY, POLY2RC, RC2POLY, RC2AC, AC2RC, POLY2AC
2048  
2049
2050
2051
2052 # name: <cell-element>
2053 # type: sq_string
2054 # elements: 1
2055 # length: 80
2056  converts an AR polynomial into an autocorrelation sequence
2057  [R] = poly2ac(a [,e
2058
2059
2060
2061 # name: <cell-element>
2062 # type: sq_string
2063 # elements: 1
2064 # length: 7
2065 poly2ar
2066
2067
2068 # name: <cell-element>
2069 # type: sq_string
2070 # elements: 1
2071 # length: 288
2072  Converts AR polymials into autoregressive parameters. 
2073  Multiple polynomials can be converted. 
2074
2075  function  [AR] = poly2ar(A);
2076
2077   INPUT:
2078  A     AR polynomial, each row represents one polynomial
2079
2080   OUTPUT
2081  AR    autoregressive model parameter   
2082
2083  see also ACOVF ACORF DURLEV RC2AR AR2POLY
2084
2085
2086
2087 # name: <cell-element>
2088 # type: sq_string
2089 # elements: 1
2090 # length: 54
2091  Converts AR polymials into autoregressive parameters.
2092
2093
2094
2095 # name: <cell-element>
2096 # type: sq_string
2097 # elements: 1
2098 # length: 7
2099 poly2rc
2100
2101
2102 # name: <cell-element>
2103 # type: sq_string
2104 # elements: 1
2105 # length: 434
2106  converts AR-polynomial into reflection coefficients
2107  [RC,R0] = poly2rc(A [,Efinal])
2108
2109   INPUT:
2110  A     AR polynomial, each row represents one polynomial
2111  Efinal    is the final prediction error variance (default value 1)
2112
2113   OUTPUT
2114  RC    reflection coefficients
2115  R0    is the variance (autocovariance at lag=0) based on the 
2116         prediction error
2117
2118
2119  see also ACOVF ACORF AR2RC RC2AR DURLEV AC2POLY, POLY2RC, RC2POLY, RC2AC, AC2RC, POLY2AC
2120
2121
2122
2123 # name: <cell-element>
2124 # type: sq_string
2125 # elements: 1
2126 # length: 80
2127  converts AR-polynomial into reflection coefficients
2128  [RC,R0] = poly2rc(A [,Efin
2129
2130
2131
2132 # name: <cell-element>
2133 # type: sq_string
2134 # elements: 1
2135 # length: 5
2136 rc2ac
2137
2138
2139 # name: <cell-element>
2140 # type: sq_string
2141 # elements: 1
2142 # length: 176
2143  converts reflection coefficients to autocorrelation sequence
2144  [R] = rc2ac(RC,R0);
2145
2146  see also ACOVF ACORF AR2RC RC2AR DURLEV AC2POLY, POLY2RC, RC2POLY, RC2AC, AC2RC, POLY2AC
2147  
2148
2149
2150
2151 # name: <cell-element>
2152 # type: sq_string
2153 # elements: 1
2154 # length: 80
2155  converts reflection coefficients to autocorrelation sequence
2156  [R] = rc2ac(RC,R0
2157
2158
2159
2160 # name: <cell-element>
2161 # type: sq_string
2162 # elements: 1
2163 # length: 5
2164 rc2ar
2165
2166
2167 # name: <cell-element>
2168 # type: sq_string
2169 # elements: 1
2170 # length: 1000
2171  converts reflection coefficients into autoregressive parameters
2172  uses the Durbin-Levinson recursion for multiple channels
2173  function  [AR,RC,PE,ACF] = rc2ar(RC);
2174  function  [MX,PE] = rc2ar(RC);
2175
2176   INPUT:
2177  RC    reflection coefficients
2178
2179   OUTPUT
2180  AR    autoregressive model parameter   
2181  RC    reflection coefficients (= -PARCOR coefficients)
2182  PE    remaining error variance (relative to PE(1)=1)
2183  MX    transformation matrix between ARP and RC (Attention: needs O(p^2) memory)
2184         arp=MX(:,K*(K-1)/2+(1:K));
2185         rc =MX(:,(1:K).*(2:K+1)/2);
2186
2187  All input and output parameters are organized in rows, one row 
2188  corresponds to the parameters of one channel
2189
2190  see also ACOVF ACORF DURLEV AR2RC 
2191  
2192  REFERENCES:
2193   P.J. Brockwell and R. A. Davis "Time Series: Theory and Methods", 2nd ed. Springer, 1991.
2194   S. Haykin "Adaptive Filter Theory" 3rd ed. Prentice Hall, 1996.
2195   M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. 
2196   W.S. Wei "Time Series Analysis" Addison Wesley, 1990.
2197
2198
2199
2200 # name: <cell-element>
2201 # type: sq_string
2202 # elements: 1
2203 # length: 80
2204  converts reflection coefficients into autoregressive parameters
2205  uses the Durbi
2206
2207
2208
2209 # name: <cell-element>
2210 # type: sq_string
2211 # elements: 1
2212 # length: 7
2213 rc2poly
2214
2215
2216 # name: <cell-element>
2217 # type: sq_string
2218 # elements: 1
2219 # length: 174
2220  converts reflection coefficients into an AR-polynomial
2221  [a,efinal] = rc2poly(K)
2222
2223  see also ACOVF ACORF AR2RC RC2AR DURLEV AC2POLY, POLY2RC, RC2POLY, RC2AC, AC2RC, POLY2AC
2224  
2225
2226
2227
2228 # name: <cell-element>
2229 # type: sq_string
2230 # elements: 1
2231 # length: 80
2232  converts reflection coefficients into an AR-polynomial
2233  [a,efinal] = rc2poly(K)
2234
2235
2236
2237 # name: <cell-element>
2238 # type: sq_string
2239 # elements: 1
2240 # length: 4
2241 rmle
2242
2243
2244 # name: <cell-element>
2245 # type: sq_string
2246 # elements: 1
2247 # length: 432
2248  RMLE estimates AR Parameters using the Recursive Maximum Likelihood 
2249  Estimator according to [1]
2250  
2251  Use: [a,VAR]=rmle(x,p)
2252  Input: 
2253  x is a column vector of data
2254  p is the model order
2255  Output:
2256  a is a vector with the AR parameters of the recursive MLE
2257  VAR is the excitation white noise variance estimate
2258
2259  Reference(s):
2260  [1] Kay S.M., Modern Spectral Analysis - Theory and Applications. 
2261        Prentice Hall, p. 232-233, 1988. 
2262
2263
2264
2265
2266 # name: <cell-element>
2267 # type: sq_string
2268 # elements: 1
2269 # length: 80
2270  RMLE estimates AR Parameters using the Recursive Maximum Likelihood 
2271  Estimator
2272
2273
2274
2275 # name: <cell-element>
2276 # type: sq_string
2277 # elements: 1
2278 # length: 7
2279 sbispec
2280
2281
2282 # name: <cell-element>
2283 # type: sq_string
2284 # elements: 1
2285 # length: 26
2286  SBISPEC show BISPECTRUM 
2287
2288
2289
2290 # name: <cell-element>
2291 # type: sq_string
2292 # elements: 1
2293 # length: 26
2294  SBISPEC show BISPECTRUM 
2295
2296
2297
2298
2299 # name: <cell-element>
2300 # type: sq_string
2301 # elements: 1
2302 # length: 5
2303 selmo
2304
2305
2306 # name: <cell-element>
2307 # type: sq_string
2308 # elements: 1
2309 # length: 2179
2310  Model order selection of an autoregrssive model
2311  [FPE,AIC,BIC,SBC,MDL,CAT,PHI,optFPE,optAIC,optBIC,optSBC,optMDL,optCAT,optPHI]=selmo(E,N);
2312
2313  E      Error function E(p)
2314  N      length of the data set, that was used for calculating E(p)
2315  show  optional; if given the parameters are shown
2316
2317  FPE    Final Prediction Error (Kay 1987, Wei 1990, Priestley 1981  -> Akaike 1969)
2318  AIC    Akaike Information Criterion (Marple 1987, Wei 1990, Priestley 1981 -> Akaike 1974)
2319  BIC    Bayesian Akaike Information Criterion (Wei 1990, Priestley 1981 -> Akaike 1978,1979)
2320  CAT    Parzen's CAT Criterion (Wei 1994 -> Parzen 1974)
2321  MDL    Minimal Description length Criterion (Marple 1987 -> Rissanen 1978,83)
2322  SBC    Schwartz's Bayesian Criterion (Wei 1994; Schwartz 1978)
2323  PHI    Phi criterion (Pukkila et al. 1988, Hannan 1980 -> Hannan & Quinn, 1979)
2324  HAR    Haring G. (1975)
2325  JEW    Jenkins and Watts (1968)
2326
2327  optFPE         order where FPE is minimal
2328  optAIC         order where AIC is minimal
2329  optBIC         order where BIC is minimal
2330  optSBC         order where SBC is minimal
2331  optMDL         order where MDL is minimal
2332  optCAT         order where CAT is minimal
2333  optPHI         order where PHI is minimal
2334
2335  usually is 
2336  AIC > FPE > *MDL* > PHI > SBC > CAT ~ BIC
2337
2338  REFERENCES:
2339   P.J. Brockwell and R.A. Davis "Time Series: Theory and Methods", 2nd ed. Springer, 1991.
2340   S. Haykin "Adaptive Filter Theory" 3ed. Prentice Hall, 1996.
2341   M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. 
2342   C.E. Shannon and W. Weaver "The mathematical theory of communication" University of Illinois Press, Urbana 1949 (reprint 1963).
2343   W.S. Wei "Time Series Analysis" Addison Wesley, 1990.
2344   Jenkins G.M. Watts D.G "Spectral Analysis and its applications", Holden-Day, 1968.
2345   G. Haring  "Über die Wahl der optimalen Modellordnung bei der Darstellung von stationären Zeitreihen mittels Autoregressivmodell als Basis der Analyse von EEG - Biosignalen mit Hilfe eines Digitalrechners", Habilitationschrift - Technische Universität Graz, Austria, 1975.
2346                   (1)"About selecting the optimal model at the representation of stationary time series by means of an autoregressive model as basis of the analysis of EEG - biosignals by means of a digital computer)"
2347
2348
2349
2350
2351 # name: <cell-element>
2352 # type: sq_string
2353 # elements: 1
2354 # length: 80
2355  Model order selection of an autoregrssive model
2356  [FPE,AIC,BIC,SBC,MDL,CAT,PHI,o
2357
2358
2359
2360 # name: <cell-element>
2361 # type: sq_string
2362 # elements: 1
2363 # length: 6
2364 selmo2
2365
2366
2367 # name: <cell-element>
2368 # type: sq_string
2369 # elements: 1
2370 # length: 271
2371  SELMO2 - model order selection for univariate and multivariate 
2372    autoregressive models 
2373  
2374   X = selmo(y,Pmax); 
2375   
2376   y     data series
2377   Pmax maximum model order 
2378   X.A, X.B, X.C parameters of AR model 
2379   X.OPT... various optimization criteria
2380  
2381  see also: SELMO, MVAR, 
2382
2383
2384
2385 # name: <cell-element>
2386 # type: sq_string
2387 # elements: 1
2388 # length: 80
2389  SELMO2 - model order selection for univariate and multivariate 
2390    autoregressi
2391
2392
2393
2394 # name: <cell-element>
2395 # type: sq_string
2396 # elements: 1
2397 # length: 8
2398 sinvest1
2399
2400
2401 # name: <cell-element>
2402 # type: sq_string
2403 # elements: 1
2404 # length: 93
2405 SINVEST1 shows the parameters of a time series calculated by INVEST1
2406  only called by INVEST1
2407
2408
2409
2410 # name: <cell-element>
2411 # type: sq_string
2412 # elements: 1
2413 # length: 80
2414 SINVEST1 shows the parameters of a time series calculated by INVEST1
2415  only calle
2416
2417
2418
2419 # name: <cell-element>
2420 # type: sq_string
2421 # elements: 1
2422 # length: 10
2423 sumskipnan
2424
2425
2426 # name: <cell-element>
2427 # type: sq_string
2428 # elements: 1
2429 # length: 1234
2430  SUMSKIPNAN adds all non-NaN values. 
2431
2432  All NaN's are skipped; NaN's are considered as missing values. 
2433  SUMSKIPNAN of NaN's only  gives O; and the number of valid elements is return. 
2434  SUMSKIPNAN is also the elementary function for calculating 
2435  various statistics (e.g. MEAN, STD, VAR, RMS, MEANSQ, SKEWNESS, 
2436  KURTOSIS, MOMENT, STATISTIC etc.) from data with missing values.  
2437  SUMSKIPNAN implements the DIMENSION-argument for data with missing values.
2438  Also the second output argument return the number of valid elements (not NaNs) 
2439  
2440  Y = sumskipnan(x [,DIM])
2441  [Y,N,SSQ] = sumskipnan(x [,DIM])
2442  [...] = sumskipnan(x, DIM, W)
2443  
2444  x      input data      
2445  DIM    dimension (default: [])
2446         empty DIM sets DIM to first non singleton dimension     
2447  W      weight vector for weighted sum, numel(W) must fit size(x,DIM)
2448  Y      resulting sum
2449  N      number of valid (not missing) elements
2450  SSQ    sum of squares
2451
2452  the function FLAG_NANS_OCCURED() returns whether any value in x
2453   is a not-a-number (NaN)
2454
2455  features:
2456  - can deal with NaN's (missing values)
2457  - implements dimension argument. 
2458  - computes weighted sum 
2459  - compatible with Matlab and Octave
2460
2461  see also: FLAG_NANS_OCCURED, SUM, NANSUM, MEAN, STD, VAR, RMS, MEANSQ, 
2462       SSQ, MOMENT, SKEWNESS, KURTOSIS, SEM
2463
2464
2465
2466 # name: <cell-element>
2467 # type: sq_string
2468 # elements: 1
2469 # length: 36
2470  SUMSKIPNAN adds all non-NaN values.
2471
2472
2473
2474 # name: <cell-element>
2475 # type: sq_string
2476 # elements: 1
2477 # length: 7
2478 tsademo
2479
2480
2481 # name: <cell-element>
2482 # type: sq_string
2483 # elements: 1
2484 # length: 42
2485  TSADEMO        demonstrates INVEST1 on EEG data
2486
2487
2488
2489 # name: <cell-element>
2490 # type: sq_string
2491 # elements: 1
2492 # length: 42
2493  TSADEMO        demonstrates INVEST1 on EEG data
2494
2495
2496
2497
2498 # name: <cell-element>
2499 # type: sq_string
2500 # elements: 1
2501 # length: 3
2502 ucp
2503
2504
2505 # name: <cell-element>
2506 # type: sq_string
2507 # elements: 1
2508 # length: 476
2509  UCP(C) tests if the polynomial C is a Unit-Circle-Polynomial.
2510         It tests if all roots lie inside the unit circle like
2511        B=ucp(C) does the same as
2512         B=all(abs(roots(C))<1) but much faster.
2513         The Algorithm is based on the Jury-Scheme.
2514         C are the elements of the Polynomial
2515         C(1)*X^N + ... + C(N)*X + C(N+1).
2516  
2517  REFERENCES:
2518   O. Foellinger "Lineare Abtastsysteme", Oldenburg Verlag, Muenchen, 1986.
2519   F. Gausch "Systemtechnik", Textbook, University of Technology Graz, 1993. 
2520
2521
2522
2523 # name: <cell-element>
2524 # type: sq_string
2525 # elements: 1
2526 # length: 62
2527  UCP(C) tests if the polynomial C is a Unit-Circle-Polynomial.
2528
2529
2530
2531 # name: <cell-element>
2532 # type: sq_string
2533 # elements: 1
2534 # length: 5
2535 y2res
2536
2537
2538 # name: <cell-element>
2539 # type: sq_string
2540 # elements: 1
2541 # length: 534
2542  Y2RES evaluates basic statistics of a data series
2543  
2544  R = y2res(y)
2545         several statistics are estimated from each column of y
2546  
2547  OUTPUT:
2548    R.N     number of samples, NaNs are not counted 
2549    R.SUM   sum of samples
2550    R.MEAN  mean
2551    R.STD   standard deviation 
2552    R.VAR   variance
2553    R.Max   Maximum
2554    R.Min   Minimum 
2555    ...   and many more including:  
2556         MEDIAN, Quartiles, Variance, standard error of the mean (SEM), 
2557         Coefficient of Variation, Quantization (QUANT), TRIMEAN, SKEWNESS, 
2558         KURTOSIS, Root-Mean-Square (RMS), ENTROPY 
2559  
2560
2561
2562
2563 # name: <cell-element>
2564 # type: sq_string
2565 # elements: 1
2566 # length: 80
2567  Y2RES evaluates basic statistics of a data series
2568  
2569  R = y2res(y)
2570         several stat
2571
2572
2573
2574
2575