kza                   package:kza                   R Documentation

_K_o_l_m_o_g_o_r_o_v-_Z_u_r_b_e_n_k_o _A_d_a_p_t_i_v_e

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

     KZA will recover a 2-dimensional image buried in noise. The KZA
     Algorithm can recover break in a signal buried in noise.

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

     kza(x, q, k = 3, m = 0, tol = 1.0e-5)

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

       x: A vector of the time series or a matrix of an image.

       q: The half length of the window size for the filter.

       k: Number of iterations to run the filter.

       m: Minimum size of filtering window.

     tol: The smallest value to accept as nonzero.

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

     The selection of parameters of KZA depend on the nature of the
     data.

_A_u_t_h_o_r(_s):

     Brian Close <bclose@nycap.rr.com> and Igor Zurbenko
     <IZurbenko@albany.edu>

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

     I. Zurbenko, P.S. Porter, S.T. Rao, J.Y. Ku, R. Gui, R.E. Eskridge
     Detecting Discontinuities in Time Series of Upper-air Data: 
     Development and Demonstration of an Adaptive Filter Technique.
     Journal of Climate: (1996) Vol. 9, No. 12, pp. 3548 3560. <URL:
     http://ams.allenpress.com/amsonline/?request=get-abstract&issn=152
     0-0442&volume=009&issue=12&page=3548>

     Kevin L. Civerolo, Elvira Brankov, S. T. Rao, Igor Zurbenko
     Assessing the impact of the acid deposition control program.
     Atmospheric Environment 35 (2001) 4135-4148 <URL:
     http://www.elsevier.com/locate/atmosenv>

     J.Chen, I.Zurbenko, Nonparametric Boundary detection,
     Communications in Statistics,  Theory and Methods, Vol.26, 12,
     2999-3014, 1997.

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

     # image detection
     a <- matrix(rep(0,100*100),nrow=100)
     a[35:70,35:70]<-1
     a <- a + matrix(rnorm(100*100,0,2),nrow=100)
     k <- kza(a,15)

     par(mfrow=c(1,2))
     image(a,col=gray(seq(0,1,1/255)))
     image(k,col=gray(seq(0,1,1/255)))

     # another example
     a <- matrix(rep(0,100*100),nrow=100)
     a[35:70,35:70]<-1
     a <- a + matrix(rnorm(100*100,0,2),nrow=100)
     k <- kza(a,15)

     par(mfrow=c(1,2))
     x <- seq(1,100)
     y <- x
     op <- par(bg = "white")
     persp(x, y, a, zlab="z", zlim=c(-4,6), ticktype="detailed", 
         theta = 30, phi = 30, col = "lightblue")
     persp(x, y, k, zlab="z", zlim=c(0,2), ticktype="detailed", 
         theta = 30, phi = 30, col = "lightblue")

     # this is an example of detection of a break point in a time series
     # seasonal data
     yrs <- 20
     t <- seq(0,yrs,length=yrs*365)
     q <- 365

     #noise
     e <- rnorm(n = length(t),0,1)
     trend <- seq(0,-1,length=length(t))

     #signal
     bkpt <- 3452
     brk <- c(rep(0,bkpt),rep(0.5,length(t)-bkpt))
     signal <- trend + brk

     # y = seasonal + trend + break point + noise
     y <- sin(2*pi*t) + signal + e

     k.kz <- kz(y,q)

     # kza reconstruction of the signal
     k.kza <- kza(y,q,m=10)

     par(mfrow=c(1,2))
     plot(y,type="l", ylim=c(-3,3))
     plot(signal,type="l",ylim=c(-3,3), 
         main="Signal and KZA Reconstruction")
     lines(k.kza, col=4)

