PsiJmat              package:wavethresh              R Documentation

_C_o_m_p_u_t_e _d_i_s_c_r_e_t_e _a_u_t_o_c_o_r_r_e_l_a_t_i_o_n _w_a_v_e_l_e_t_s _b_u_t _r_e_t_u_r_n _r_e_s_u_l_t _i_n _m_a_t_r_i_x _f_o_r_m.

_D_e_s_c_r_i_p_t_i_o_n:

     This function computes discrete autocorrelation wavelets using the
     'PsiJ' function but it returns the results as a matrix rather than
     a list object.

_U_s_a_g_e:

     PsiJmat(J, filter.number = 10, family = "DaubLeAsymm", OPLENGTH=1e+05)

_A_r_g_u_m_e_n_t_s:

       J: Discrete autocorrelation wavelets will be computed for scales
          -1 up to scale J. This number should be a negative integer.

filter.number: The index of the wavelet used to compute the discrete
          autocorrelation wavelets.

  family: The family of wavelet used to compute the discrete
          autocorrelation wavelets.

OPLENGTH: This integer variable defines some workspace of length
          OPLENGTH. The code uses this workspace. If the workspace is
          not long enough then the routine will stop and probably tell
          you what OPLENGTH should be set to.

_D_e_t_a_i_l_s:

     The discrete autocorrelation wavelet values are computed using the
     'PsiJ' function. This function merely organises them into a matrix
     form.

_V_a_l_u_e:

     A matrix containing -J rows and a number of columns less than
     OPLENGTH. Each row contains the values of the discrete
     autocorrelation wavelet for a different scale. Row one contains
     the scale -1 coefficients, row two contains the scale -2, and so
     on. 

     The number of columns is an odd number. The middle position of
     each row is the value of the discrete autocorrelation wavelet at
     zero - this is always 1. The discrete autocorrelation wavelet is
     symmetric about this point. 

     _Important_ Apart from the central element none of the other
     columns line up in this way. This could be improved upon.

_R_E_L_E_A_S_E:

     Version 3.9 Copyright Guy Nason 1998

_R_e_f_e_r_e_n_c_e_s:

     Nason, G.P., von Sachs, R. and Kroisandt, G. (1998). Wavelet
     processes and adaptive estimation of the evolutionary wavelet
     spectrum. _Technical Report_, Department of Mathematics University
     of Bristol/ Fachbereich Mathematik, Kaiserslautern.

_S_e_e _A_l_s_o:

     'PsiJ'

_E_x_a_m_p_l_e_s:

     #
     # As a simple first example we shall compute the matrix containing
     # the discrete autocorrelation wavelets up to scale 3.
     #
     #PsiJmat(-3, filter.number=1, family="DaubExPhase")
     #Computing PsiJ
     #Took  0.25  seconds
     #       [,1]  [,2]   [,3] [,4]   [,5]  [,6]   [,7] [,8]   [,9] [,10]  [,11] 
     #[1,]  0.000  0.00  0.000  0.0  0.000  0.00 -0.500    1 -0.500  0.00  0.000
     #[2,]  0.000  0.00  0.000  0.0 -0.250 -0.50  0.250    1  0.250 -0.50 -0.250
     #[3,] -0.125 -0.25 -0.375 -0.5 -0.125  0.25  0.625    1  0.625  0.25 -0.125
     #     [,12]  [,13] [,14]  [,15] 
     #[1,]   0.0  0.000  0.00  0.000
     #[2,]   0.0  0.000  0.00  0.000
     #[3,]  -0.5 -0.375 -0.25 -0.125
     #
     # Note that this contains 3 rows (since J=-3).
     # Each row contains the same discrete autocorrelation wavelet at different
     # scales and hence different resolutions.
     # Compare to the output given by PsiJ for the
     # equivalent wavelet and scales.
     # Note also that apart from column 8 which contains 1 (the value of the
     # ac wavelet at zero) none of the other columns line up. E.g. the value of
     # this wavelet at 1/2 is -0.5: this appears in columns 9, 10 and 12
     # we could have written it differently so that they should line up.
     # I might do this in the future. 
     #
     #
     # Let's compute the matrix containing the discrete autocorrelation
     # wavelets up to scale 6 using Daubechies N=10 least-asymmetric
     # wavelets.
     #
     #P6mat <- PsiJmat(-6, filter.number=10, family="DaubLeAsymm")
     #
     # What is the dimension of this matrix?
     #
     #dim(P6mat)
     #[1]    6 2395
     #
     # Hmmm. Pretty large, so we shan't print it out.
     #
     # However, these are the ac wavelets... Therefore if we compute their
     # inner product we should get the same as if we used the ipndacw
     # function directly.
     #
     #P6mat 
     #             [,1]         [,2]         [,3]         [,4]         [,5] 
     #[1,] 1.839101e+00 3.215934e-01 4.058155e-04 8.460063e-06 4.522125e-08
     #[2,] 3.215934e-01 3.035353e+00 6.425188e-01 7.947454e-04 1.683209e-05
     #[3,] 4.058155e-04 6.425188e-01 6.070419e+00 1.285038e+00 1.589486e-03
     #[4,] 8.460063e-06 7.947454e-04 1.285038e+00 1.214084e+01 2.570075e+00
     #[5,] 4.522125e-08 1.683209e-05 1.589486e-03 2.570075e+00 2.428168e+01
     #[6,] 5.161675e-10 8.941666e-08 3.366416e-05 3.178972e-03 5.140150e+00
     #             [,6] 
     #[1,] 5.161675e-10
     #[2,] 8.941666e-08
     #[3,] 3.366416e-05
     #[4,] 3.178972e-03
     #[5,] 5.140150e+00
     #[6,] 4.856335e+01
     #
     # Let's check it against the ipndacw call
     #
     #ipndacw(-6, filter.number=10, family="DaubLeAsymm")
     #             -1           -2           -3           -4           -5 
     #-1 1.839101e+00 3.215934e-01 4.058155e-04 8.460063e-06 4.522125e-08
     #-2 3.215934e-01 3.035353e+00 6.425188e-01 7.947454e-04 1.683209e-05
     #-3 4.058155e-04 6.425188e-01 6.070419e+00 1.285038e+00 1.589486e-03
     #-4 8.460063e-06 7.947454e-04 1.285038e+00 1.214084e+01 2.570075e+00
     #-5 4.522125e-08 1.683209e-05 1.589486e-03 2.570075e+00 2.428168e+01
     #-6 5.161675e-10 8.941666e-08 3.366416e-05 3.178972e-03 5.140150e+00
     #             -6 
     #-1 5.161675e-10
     #-2 8.941666e-08
     #-3 3.366416e-05
     #-4 3.178972e-03
     #-5 5.140150e+00
     #-6 4.856335e+01
     #
     # Yep, they're the same.
     #

