comparison scripts/signal/diffpara.m @ 3449:858695b3ed62

[project @ 2000-01-18 04:08:59 by jwe]
author jwe
date Tue, 18 Jan 2000 04:09:14 +0000
parents f8dde1807dee
children e031284eea27
comparison
equal deleted inserted replaced
3448:0fb75d95b14f 3449:858695b3ed62
12 ## 12 ##
13 ## You should have received a copy of the GNU General Public License 13 ## You should have received a copy of the GNU General Public License
14 ## along with this file. If not, write to the Free Software Foundation, 14 ## along with this file. If not, write to the Free Software Foundation,
15 ## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 15 ## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16 16
17 ## usage: [d, D] = diffpara (X [, a [, b]]) 17 ## -*- texinfo -*-
18 ## 18 ## @deftypefn {Function File} {[@var{d}, @var{D}]} = diffpara (@var{x}, @var{a}, @var{b})
19 ## Returns the estimator d for the differencing parameter of an 19 ## Return the estimator @var{d} for the differencing parameter of an
20 ## integrated time series. 20 ## integrated time series.
21 ## 21 ##
22 ## The frequencies from [2*pi*a/T, 2*pi*b/T] are used for the 22 ## The frequencies from @code{[2*pi*@var{a}/@var{T},
23 ## estimation. If b is omitted, the interval [2*pi/T, 2*pi*a/T] is used, 23 ## 2*pi*@var{b}/@var{T}]} are used for the estimation. If @var{b} is
24 ## if both b and a are omitted then a = 0.5 * sqrt(T) and b = 1.5 * 24 ## omitted, the interval @code{[2*pi/@var{T}, 2*pi*@var{a}/@var{T}]} is
25 ## sqrt(T) is used, where T is the sample size. If X is a matrix, the 25 ## used. If both @var{b} and @var{a} are omitted then @code{@var{a} =
26 ## differencing parameter of every single column is estimated. 26 ## 0.5 * sqrt(@var{T})} and @code{@var{b} = 1.5 * sqrt(@var{T})} is
27 ## used, where @var{T} is the sample size. If @var{x} is a matrix, the
28 ## differencing parameter of each column is estimated.
27 ## 29 ##
28 ## D contains the estimators for all frequencies in the intervals 30 ## The estimators for all frequencies in the intervals
29 ## described above, d is simply mean(D). 31 ## described above is returned in @var{D}. The value of @var{d} is
32 ## simply the mean of @var{D}.
30 ## 33 ##
31 ## Reference: Brockwell, Peter J. & Davis, Richard A. Time Series: 34 ## Reference: Brockwell, Peter J. & Davis, Richard A. Time Series:
32 ## Theory and Methods Springer 1987 35 ## Theory and Methods Springer 1987.
36 ## @end deftypefn
33 37
34 ## Author: FL <Friedrich.Leisch@ci.tuwien.ac.at> 38 ## Author: FL <Friedrich.Leisch@ci.tuwien.ac.at>
35 ## Description: Estimate the fractional differencing parameter 39 ## Description: Estimate the fractional differencing parameter
36 40
37 function [d, D] = diffpara (X, a, b) 41 function [d, D] = diffpara (X, a, b)
38 42
39 if ((nargin < 1) || (nargin > 3)) 43 if ((nargin < 1) || (nargin > 3))
40 usage ("[d [, D]] = diffpara (X [, a [, b]])"); 44 usage ("[d, D] = diffpara (X, a, b)");
41 else 45 else
42 if is_vector (X) 46 if is_vector (X)
43 n = length (X); 47 n = length (X);
44 k = 1; 48 k = 1;
45 X = reshape (X, n, 1); 49 X = reshape (X, n, 1);