WaveletBasis: Finds the Discrete Wavelet Transform Matrix

Description Usage Arguments Value Examples

View source: R/basis.R

Description

Uses the functions wavDWT and reconstruct from the wmtsa package to find the transformation matrix of the given wavelet basis type. Each column of the matrix is a wavelet basis function.

Usage

1
WaveletBasis(N, train = NULL, wavelet = "Haar")

Arguments

N

number of wavelet basis functions to include in matrix. Note that N must be a power of 2, otherwise the matrix will include NA's. The reason for this has to do with how the wavelet basis is defined.

train

indices corresponding to which rows of the matrix to keep. Default is to keep all rows.

wavelet

the type of wavelet basis to use. See wavDaubechies from wmtsa for types.

Value

A P x N discrete wavelet transform matrix, where P is equal to the length of train and N is the number of basis. If train is NULL then P equals N.

Examples

1
2
3
4
5
6
# Find first 8 basis functions of the Haar wavelet type
w.Haar <- WaveletBasis(8)

# Find first 8 basis functions of the d4 wavelet type, keeping the first
# half of the rows
w.d4 <- WaveletBasis(8, 1:4, wavelet='d4')

gmatt18/bcs documentation built on May 14, 2017, 12:56 p.m.