mld                   package:ade4                   R Documentation

_M_u_l_t_i _L_e_v_e_l _D_e_c_o_m_p_o_s_i_t_i_o_n _o_f _u_n_i_d_i_m_e_n_s_i_o_n_a_l _d_a_t_a

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

     The function 'mld' performs an additive decomposition of the input
     vector 'x' onto sub-spaces associated  to an orthonormal
     orthobasis. The sub-spaces are defined by levels of the input
     factor 'level'. The function 'haar2level' builds the factor
     'level' such that the multi level decomposition corresponds
     exactly to a multiresolution analysis performed with the haar
     basis.

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

     mld(x, orthobas, level, na.action = c("fail", "mean"),
      plot = TRUE, dfxy = NULL, phylog = NULL, ...)
     haar2level(x)

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

       x: is a vector or a time serie containing the data to be
          decomposed. This must be a dyadic length vector (power of 2)
          for the function 'haar2level'.

orthobas: is a data frame containing the vectors of the orthonormal
          basis.

   level: is a factor which levels define the sub-spaces on which the
          function 'mld' performs the additive decomposition.

na.action: if 'fail' stops the execution of the current expression when
          'x' contains any missing value. If 'mean' replaces any
          missing values by mean('x').

    plot: if TRUE plot 'x' and the components resulting from the
          decomposition.

    dfxy: is a data frame with two coordinates.

  phylog: is an object of class 'phylog'.

     ...: further arguments passed to or from other methods.

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

     A data frame with the components resulting from the decomposition.

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

     Sbastien Ollier ollier@biomserv.univ-lyon1.fr

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

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

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

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

     'gridrowcol', 'orthobasis', 'orthogram', 'mra' for multiresolution
     analysis with various families of wavelets

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

     ## Not run: 
     # decomposition of a time serie
     data(co2)
     x <- log(co2)
     orthobas <- orthobasis.line(length(x))
     level<-rep("D", 467)
     level[1:3]<-rep("A", 3)
     level[c(77,78,79,81)]<-rep("B", 4)
     level[156]<-"C"
     level<-as.factor(level)
     res <- mld(x, orthobas, level)
     sum(scale(x, scale = FALSE) - apply(res, 1, sum))
     ## End(Not run)
     # decomposition of a biological trait on a phylogeny
     data(palm)
     vfruit<-palm$traits$vfruit
     vfruit<-scalewt(vfruit)   
     palm.phy<-newick2phylog(palm$tre)
     level <- rep("F", 65)
     level[c(4, 21, 3, 6, 13)] <- LETTERS[1:5]
     level <- as.factor(level)
     res <- mld(as.vector(vfruit), palm.phy$Bscores, level,
      phylog = palm.phy, clabel.nod = 0.7, f.phylog=0.8,
       csize = 2, clabel.row = 0.7, clabel.col = 0.7)

