\HeaderA{power.sum}{Sums of wavelets raised to integer powers}{power.sum}
\keyword{manip}{power.sum}
\begin{Description}\relax
Computes a sum expressed in terms of mother wavelets raised to the power two, three, or four. Either the exact solution or a faster approximation can be computed.
\end{Description}
\begin{Usage}
\begin{verbatim}
power.sum(alphas.wd, pow = 2, verbose = TRUE, type = "approx", plotfn = FALSE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{alphas.wd}] A \code{wd.object}, the \code{D} component of which contains the coefficients of the powers of wavelets. The entry which would normalLy be the coefficient of the wavelet at scale j and location k is the coefficient of the same wavelet raised to the power pow.

If \code{pow=2}, then the overall scaling function coefficient is included in the sum, otherwise the C component is ignored completely. 

The \code{filter.number} and \code{/link\{family\}} components of \code{alphas.wd} are used to determine which wavelet is used.
\item[\code{pow}] The power to which the wavelets are raised; it can take values 2, 3, or 4.
\item[\code{verbose}] If \code{verbose=TRUE}, progress reports are printed while the sum is being evaluated.
\item[\code{type}] If \code{type="approx"}, the approximation is computed, if \code{type="exact"}, the exact solution is computed, and if \code{type="both"} both the exact and approximate solutions are found.
\item[\code{plotfn}] If \code{plotfn=TRUE}, the solution(s) found are plotted.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
For the approximate method, the powers of mother wavelets are represented by scaling functions (father wavelets) at a finer level. This is discussed in Barber, Nason, \& Silverman (2001). 

Sums of powers of wavelets are used in the computation of posterior credible intervals for wavelet regression estimators; see the documentation for the function \code{\LinkA{wave.band}{wave.band}} for more details.
\end{Details}
\begin{Value}
A vector containing the solution (either exact or approximate), or a list containing both solutions, depending on the value of "type".
\end{Value}
\begin{Section}{SIDE EFFECTS}
If \code{plotfn=TRUE}, the solution(s) found are plotted.
\end{Section}
\begin{SeeAlso}\relax
\code{\LinkA{wave.band}{wave.band}}
\end{SeeAlso}

