\HeaderA{dof}{Compute number of non-zero coefficients in wd object}{dof}
\keyword{models}{dof}
\begin{Description}\relax
Compute number of non-zero coefficients in \code{\LinkA{wd}{wd}} object
\end{Description}
\begin{Usage}
\begin{verbatim}
dof(wd)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{wd}] A \code{wavelet decomposition} object (such as that returned by the \code{\LinkA{wd}{wd}} function).
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Very simple function that counts the number of non-zero coefficients in a \code{\LinkA{wd}{wd}} class object.
\end{Details}
\begin{Value}
An integer that represents the number of non-zero coefficients in the input \code{\LinkA{wd}{wd}} object.
\end{Value}
\begin{Section}{RELEASE}
Version 3.0 Copyright Guy Nason 1994
\end{Section}
\begin{SeeAlso}\relax
\code{\LinkA{wd}{wd}}, \code{\LinkA{wd.object}{wd.object}}, \code{\LinkA{threshold}{threshold}}, \code{\LinkA{threshold.wd}{threshold.wd}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
#
# Let's generate some purely random numbers!!
#
#myrandom <- rnorm(512)
#
# Take the discrete wavelet transform
#
#myrandomWD <- wd(myrandom)
#
# How many coefficients are non-zero?
#
#dof(myrandomWD)
# [1] 512
#
# All of them were nonzero!
#
# Threshold it
#
#myrandomWDT <- threshold(myrandomWD, policy="universal")
#
# Now lets see how many are nonzero
#
#dof(myrandomWDT)
# [1] 8
#
# Wow so 504 of the coefficients were set to zero! Spooky!
#
\end{ExampleCode}
\end{Examples}

