1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
\name{dof}
\alias{dof}
\title{Compute number of non-zero coefficients in wd object}
\description{
Compute number of non-zero coefficients in \code{\link{wd}} object
}
\usage{
dof(wd)
}
\arguments{
\item{wd}{A \code{wavelet decomposition} object (such as that returned by the \code{\link{wd}} function).}
}
\details{
Very simple function that counts the number of non-zero coefficients in a \code{\link{wd}} class object.
}
\value{
An integer that represents the number of non-zero coefficients in the input \code{\link{wd}} object.
}
\section{RELEASE}{Version 3.0 Copyright Guy Nason 1994 }
\seealso{
\code{\link{wd}}, \code{\link{wd.object}}, \code{\link{threshold}}, \code{\link{threshold.wd}}.
}
\examples{
#
# 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!
#
}
\keyword{models}
\author{G P Nason}
|