kz                    package:kza                    R Documentation

_K_o_l_m_o_g_o_r_o_v-_Z_u_r_b_e_n_k_o _f_i_l_t_e_r

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

     Kolmogorov-Zurbenko low-pass linear filter.

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

     kz(v, q, k = 3)

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

       v: A vector of the time series

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

       k: Number of iterations, default = 3

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

     KZ is an iterated moving average. The filter can be used with
     missing values.

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

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

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

     #seperation of signals
     yrs <- 20
     t <- seq(0,yrs,length=yrs*365)
     y <- sin(2*pi*t) + sin(3*pi*t)

     k.kz <- kz(y,365/4)
     k.kz <- k.kz[[1]]

     par(mfrow=c(3,1))
     plot(y,type="l",main="y = sin(2*pi*t)+sin(3*pi*t)")
     plot(k.kz,type="l",main="KZ filter")

     r <- y - 4*k.kz
     plot(r,type="l",main="(y - 4*kz) ~ sin(3*pi*t)")

     #another example
     #remove noise and high frequency

     yrs <- 20
     t <- seq(0,yrs,length=yrs*365)
     set.seed(6); e <- rnorm(n = length(t), sd = 1.0)
     y <- sin(2*pi*t) + sin(3*pi*t) + e

     k.kz <- kz(y,365/4)
     k.kz <- k.kz[[1]]

     par(mfrow=c(2,1))
     plot(y,type="l",main="y = sin(2*pi*t)+sin(3*pi*t) + noise")
     plot(k.kz,type="l",main="KZ filter")

