mra                 package:waveslim                 R Documentation

_M_u_l_t_i_r_e_s_o_l_u_t_i_o_n _A_n_a_l_y_s_i_s _o_f _T_i_m_e _S_e_r_i_e_s

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

     This function performs a level J additive decomposition of the
     input vector or time series using the pyramid algorithm (Mallat
     1989).

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

     mra(x, wf = "la8", J = 4, method = "modwt", boundary = "periodic")

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

       x: A vector or time series containing the data be to decomposed.
           This must be a dyadic length vector (power of 2) for
          'method="dwt"'.

      wf: Name of the wavelet filter to use in the decomposition.  By
          default this is set to '"la8"', the Daubechies orthonormal
          compactly supported wavelet of length L=8 least asymmetric
          family.

       J: Specifies the depth of the decomposition.  This must be a
          number less than or equal to log(length(x),2).

  method: Either '"dwt"' or '"modwt"'.

boundary: Character string specifying the boundary condition. If
          'boundary=="periodic"' the default, then the vector you
          decompose is assumed to be periodic on its defined interval,
           if 'boundary=="reflection"', the vector beyond its
          boundaries is assumed to be a symmetric reflection of itself.

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

     This code implements a one-dimensional multiresolution analysis
     introduced by Mallat (1989).  Either the DWT or MODWT may be used
     to compute the multiresolution analysis, which is an additive
     decomposition of the original time series.

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

     Basically, a list with the following components 

      D?: Wavelet detail vectors.

      S?: Wavelet smooth  vector.

 wavelet: Name of the wavelet filter used.

boundary: How the boundaries were handled.

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

     B. Whitcher

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

     Gencay, R., F. Selcuk and B. Whitcher (2001) _An Introduction to
     Wavelets and Other Filtering Methods in Finance and Economics_,
     Academic Press.

     Mallat, S. G. (1989) A theory for multiresolution signal
     decomposition: the wavelet representation, _IEEE Transactions on
     Pattern Analysis and Machine Intelligence_, *11*, No. 7, 674-693.

     Percival, D. B. and A. T. Walden (2000) _Wavelet Methods for Time
     Series Analysis_, Cambridge University Press.

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

     'dwt', 'modwt'.

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

     ## Easy check to see if it works...
     x <- rnorm(32)
     x.mra <- mra(x)
     sum(x - apply(matrix(unlist(x.mra), nrow=32), 1, sum))^2

     ## Figure 4.19 in Gencay, Selcuk and Whitcher (2001)
     data(ibm)     
     ibm.returns <- diff(log(ibm))
     ibm.volatility <- abs(ibm.returns)
     ## Haar
     ibmv.haar <- mra(ibm.volatility, "haar", 4, "dwt")
     names(ibmv.haar) <- c("d1", "d2", "d3", "d4", "s4")
     ## LA(8)
     ibmv.la8 <- mra(ibm.volatility, "la8", 4, "dwt")
     names(ibmv.la8) <- c("d1", "d2", "d3", "d4", "s4")
     ## plot multiresolution analysis of IBM data
     par(mfcol=c(6,1), pty="m", mar=c(5-2,4,4-2,2))
     plot.ts(ibm.volatility, axes=FALSE, ylab="", main="(a)")
     for(i in 1:5)
       plot.ts(ibmv.haar[[i]], axes=FALSE, ylab=names(ibmv.haar)[i])
     axis(side=1, at=seq(0,368,by=23), 
       labels=c(0,"",46,"",92,"",138,"",184,"",230,"",276,"",322,"",368))
     par(mfcol=c(6,1), pty="m", mar=c(5-2,4,4-2,2))
     plot.ts(ibm.volatility, axes=FALSE, ylab="", main="(b)")
     for(i in 1:5)
       plot.ts(ibmv.la8[[i]], axes=FALSE, ylab=names(ibmv.la8)[i])
     axis(side=1, at=seq(0,368,by=23), 
       labels=c(0,"",46,"",92,"",138,"",184,"",230,"",276,"",322,"",368))

