stationarity             package:fractal             R Documentation

_T_e_s_t_i_n_g _f_o_r _s_t_a_t_i_o_n_a_r_i_t_y _i_n _a _t_i_m_e _s_e_r_i_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     The Priestley-Subba Rao (PSR) test for nonstationarity is based
     upon examining how homogeneous a set of spectral density function
     (SDF) estimates are across time, across frequency, or both. The
     original test was formulated in the terms of localized lag window
     SDF estimators, but such estimators can suffer from bias due to
     leakage. To circumvent this potential problem, the SDF estimators
     are averages of multitaper SDF estimates using orthogonal
     sinusoidal tapers.

_U_s_a_g_e:

     stationarity(x, n.taper=5,
         n.block=max(c(2, floor(logb(length(x), base=2)))), significance=0.05,
         center=TRUE, recenter=FALSE)

_A_r_g_u_m_e_n_t_s:

       x: a vector containing a uniformly-sampled real-valued time
          series.

  center: a logical value. If 'TRUE', The mean value of the data is
          subtracted from the original series prior to analyis.
          Default: 'TRUE'.

 n.block: the number of non-overlapping blocks with which the time
          series will be uniformly divided. If the number of samples in
          the time series is not evenly divisible by 'n.block', then
          those samples at the of the time series that do not fit into
          the last block are ignored (rejected for analysis). Default:
          'max(c(2, floor(logb(length(x), base=2))))'.

 n.taper: an integer specifying the number of sinusoidal tapers to use
          in developing the eigenspectra for each block of the time
          series. Default: 5.

recenter: a logical value. If 'TRUE', the mean value of the data is
          subtracted from the tapered series prior to forming a
          mutltiaper SDF estimate of the input time series. Default:
          'TRUE'.

significance: the significance is the number of times you expect the
          underlying hypothesis of stationarity to fail even though
          stationarity remains true. Essentially, you are allowing for
          error in the result. A significance of 0.05 means that you
          are allowing 5 percent error, i.e., you are 95 percent
          confident in the result. Default: 0.05.

_D_e_t_a_i_l_s:

     The algorithms is outlined as follows:

     _1. _R_e-_c_e_n_t_e_r_i_n_g The time series 'x' is recentered by subtracting
          the sample mean.

     _2. _B_l_o_c_k_i_n_g The recentered series is then segmented into 'n.block'
          non-overlapping blocks in time.

     _3. _M_u_t_i_t_a_p_e_r _S_D_F _e_s_t_i_m_a_t_i_o_n For each block, 'n.taper' eigenspectra
          are formed by calculating the periodogram of the block
          windowed by each of the 'n.taper' tapers. These eiegenspectra
          are then averaged to form a multitaper SDF estimator for the
          current block.

     _4. _A_N_O_V_A _t_a_b_l_e A subset of each multitaper SDF estimate is formed
          by extracting only those values corresponding to frequencies
          which are approximately uncorrelated (the details of this
          exercise can be found in the references). Each subset (one
          per block) is stacked in rows such that an 'n.block' x M
          matrix (*S*) is formed, where M is the number of (subset)
          Fourier frequencies. The (two-factor) ANOVA table (*Y*) is
          then formed via Y=log(S) - psi(n.taper) + log(n.taper), where
          psi() is the digamma function and log is the natural
          logarithm function.

     _5. _P_S_R _s_t_a_t_i_s_t_i_c_s Using the ANOVA table and (row, column, and
          grand) means of the ANOVA table, the Priesltey-Subba Rao
          statistics are generated: one for investigating time effects,
          one for investigating frequency effects, and one which
          combines the two to test time-frequency effects. See
          references for details.

     _6. _S_t_a_t_i_o_n_a_r_i_t_y _t_e_s_t_s The PSR statisitcs are then compared to
          corresponding chi-square ('(1 - significance)' x 100)
          percentiles (normalized by psi'(n.taper) where psi'() is the
          trigamma function). Specifically, if the PSR statistic is
          found to be greater than the corresponding chi-square
          percentile, it indicates that there is a  '1 - significance'
          probability that the data is nonstationary. .in -5 

_V_a_l_u_e:

     an object of class 'stationarity'.

_S_3 _M_E_T_H_O_D_S:


     _a_s._l_i_s_t convert output to a list.

     _p_r_i_n_t prints the object. Available options are:

          _j_u_s_t_i_f_y text justification ala 'prettPrintList'. Default:
               '"left"'.

          _s_e_p header separator ala 'prettyPrintList'. Default: '":"'.

          _n._d_i_g_i_t_s number of digits ala 'prettyPrintList'. Default: 5.

          ... Additional print arguments sent directly to the
               'prettyPrintList' function). .in -5


          _s_u_m_m_a_r_y prints a summary of the stationarity test results.

_R_e_f_e_r_e_n_c_e_s:

     Priestley, M. B. and Subba Rao, T. (1969) ``A Test for
     Stationarity of Time Series", _Journal of the Royal Statistical
     Society_, Series B, *31*, pp. 140-9.

_S_e_e _A_l_s_o:

     'hurstBlock'.

_E_x_a_m_p_l_e_s:

     ## assess the stationarity of the ecgrr series 
     z <- stationarity(ecgrr, n.block=8)

     ## print the result, noting that all tests fail. 
     ## The strongest failure attributed to the 
     ## time-based fluctations of the eigenspectra 
     print(z)

     ## print a summary of the results, including the 
     ## ANOVA table of the eigenspectra 
     summary(z)

