kztp                  package:kzft                  R Documentation

_K_o_l_m_o_g_o_r_o_v-_Z_u_r_b_e_n_k_o _t_h_i_r_d-_o_r_d_e_r _p_e_r_i_o_d_o_g_r_a_m _a_n_d _s_m_o_o_t_h_i_n_g _m_e_t_h_o_d

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

     Kolmogorov-Zurbenko third-order periodogram and smoothing method

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

     kztp(x,m,k,p=1,n=1,rp1=0,rp2=0.5,cp1=0,cp2=0.5)
     variation.kztp(pg, K=dim(pg)[1])
     smooth.kztp(pg,c,K=dim(pg)[1])

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

       x: A vector of the time series

       m: Length of the window size of the KZFT

       k: Number of iterations of the KZFT

       p: Percentage of overlap between two intervals

       n: Multiple frequency rate of Fourier frequencies

     rp1: Left bound for one dimension of third-order periodogram

     rp2: Right bound for one dimension of third-order periodogram

     cp1: Left bound for the other dimension of third-order periodogram

     cp2: Right bound for the other dimension of third-order
          periodogram

      pg: The third-order periodogram of the time series

       K: Half of the maximum bandwidth of the spectral window

       c: A prespecified percentage of total variation

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

     Kolmogorov-Zurbenko third-order periodogram is calculated based on
     the Kolmogorov-Zurbenko Fourier transform. The smoothing method is
     adaptive which allows the bandwidth of the spectral window in the
     smoothed third-order periodogram running average procedure to vary
     according to the smoothness of the underlying spectral density.
     The bandwith is extended until the squared variation of the
     third-order periodogram within reaches a prespecified level of
     total variation.

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

     I. G. Zurbenko, 1986: The spectral Analysis of Time Series.
     North-Holland, 248 pp.

     I. G. Zurbenko, P. S. Porter, Construction of high-resolution
     wavelets, Signal Processing 65: 315-327, 1998.

     A. G. DiRienzo, I. G. Zurbenko, Semi-adaptive nonparametric
     spectral estimation, Journal of Computational and Graphical
     Statistics 8(1): 41-59, 1998.

     R. Neagu, I. G. Zurbenko, Algorithm for adaptively smoothing the
     log-periodgram, Journal of the Franklin Institute 340: 103-123,
     2003.

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

     'kzft', 'kzp', 'kzw'.

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

     #example 1

     t<-1:10000
     y<-sin(2*pi*0.1*t)+sin(2*pi*0.2*t)+rnorm(10000,0,3)

     pg3.y<-kztp(y,100,1,0.5,1)$mod
     pg3.y<-log(pg3.y)
     spg3.y<-smooth.kztp(pg3.y,0.01,20)$bispectrum

     omega<-seq(0,1,length=101)[2:51]

     par(mfrow=c(2,1))
     persp(omega, omega, pg3.y, theta = 30, phi = 30, expand = 0.5, col = "lightblue", 
           ltheta = 120, shade = 0.75, ticktype = "detailed", xlab = "Frequency", 
           ylab = "Frequency", main = "3rd-order Periodogram") 
     persp(omega, omega, spg3.y, theta = 30, phi = 30, expand = 0.5, col = "lightblue",
           ltheta = 120, shade = 0.75, ticktype = "detailed", xlab = "Frequency",
           ylab = "Frequency", main = "Smoothed 3rd-order Periodogram")

     filled.contour(omega,omega,pg3.y,xlab="Frequency",ylab="Frequency",
                    main="3rd-order Periodogram")
     filled.contour(omega,omega,spg3.y,xlab="Frequency",ylab="Frequency",
                    main="Smoothed 3rd-order Periodogram3")

     #example 2
     #effect of KZFT

     t<-1:50000
     y<-1.1*sin(2*pi*0.0339*t)+7*sin(2*pi*0.0366*t)+2*rnorm(50000,0,1)

     pg3.y1<-kztp(y,1000,1,0.5,1,rp1=0.02,rp2=0.05,cp1=0.02,cp2=0.05)$mod
     pg3.y2<-kztp(y,1000,3,0.5,1,rp1=0.02,rp2=0.05,cp1=0.02,cp2=0.05)$mod
     pg3.y1<-log(pg3.y1)
     pg3.y2<-log(pg3.y2)
     spg3.y1<-smooth.kztp(pg3.y1,0.01,10)$bispectrum
     spg3.y2<-smooth.kztp(pg3.y2,0.01,10)$bispectrum

     omega<-seq(0,1,length=1001)[21:51]
     par(mfrow=c(2,2))
     persp(omega, omega, pg3.y1, theta = 30, phi = 30, expand = 0.5, col = "lightblue",
           ltheta = 120, shade = 0.75, ticktype = "detailed", xlab = "Frequency",
           ylab = "Frequency", main = "Original, m=1000, k=1") 
     persp(omega, omega, pg3.y2, theta = 30, phi = 30, expand = 0.5, col = "lightblue", 
           ltheta = 120, shade = 0.75, ticktype = "detailed", xlab = "Frequency", 
           ylab = "Frequency", main = "Original, m=1000, k=3")
     persp(omega, omega, spg3.y1, theta = 30, phi = 30, expand = 0.5, col = "lightblue", 
           ltheta = 120, shade = 0.75, ticktype = "detailed", xlab = "Frequency", 
           ylab = "Frequency", main = "Smoothed, m=1000, k=1") 
     persp(omega, omega, spg3.y2, theta = 30, phi = 30, expand = 0.5, col = "lightblue", 
           ltheta = 120, shade = 0.75, ticktype = "detailed", xlab = "Frequency", 
           ylab = "Frequency", main = "Smoothed, m=1000, k=3")

     filled.contour(omega,omega,pg3.y1,xlab="Frequency",ylab="Frequency",
                    main="Original, m=1000, k=1")
     filled.contour(omega,omega,pg3.y2,xlab="Frequency",ylab="Frequency",
                    main="Original, m=1000, k=3")
     filled.contour(omega,omega,spg3.y1,xlab="Frequency",ylab="Frequency",
                    main="Smoothed, m=1000, k=1")
     filled.contour(omega,omega,spg3.y2,xlab="Frequency",ylab="Frequency",
                    main="Smoothed, m=1000, k=3")

