\HeaderA{HeavisideFunction}{Haviside and Related Functions}{HeavisideFunction}
\aliasA{Boxcar}{HeavisideFunction}{Boxcar}
\aliasA{Delta}{HeavisideFunction}{Delta}
\aliasA{H}{HeavisideFunction}{H}
\aliasA{Ramp}{HeavisideFunction}{Ramp}
\aliasA{Sign}{HeavisideFunction}{Sign}
\keyword{programming}{HeavisideFunction}
\begin{Description}\relax
A collection and description of functions 
which compute the Heaviside and related 
functions. These include the sign function, 
the delta function, the boxcar function, 
and the ramp function.
\\

The functions are:

\Tabular{ll}{
\code{H} & Computes Heaviside unit step function, \\
\code{Sign} & Just another signum function, \\
\code{Delta} & Computes delta function, \\
\code{Boxcar} & Computes boxcar function, \\
\code{Ramp} & Computes ramp function. }
\end{Description}
\begin{Usage}
\begin{verbatim}
H(x, a = 0)
Sign(x, a = 0)
Delta(x, a = 0)
Boxcar(x, a = 0.5)
Ramp(x, a = 0)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{a}] a numeric value, the location of the break.\\

\item[\code{x}] a numeric vector.

\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The Heaviside step function \code{H} is 1 for \code{x>a}, 
\code{1/2} for \code{x=a}, and \code{0} for \code{x<a}.
\\

The Sign function \code{Sign} is \code{1} for \code{x>a}, 
\code{0} for \code{x=a}, and \code{-1} for \code{x<a}.
\\

The delta function \code{Delta} is defined as: 
\code{Delta(x) = d/dx H(x-a)}.
\\

The boxcar function \code{Boxcar} is defined as: 
\code{Boxcar(x) = H(x+a) - H(x-a)}.
\\

The ramp function is defined as: 
\code{Ramp(x)= (x-a)*H(x-a)}.
\end{Details}
\begin{Value}
returns the function values of the selected function.
\end{Value}
\begin{Note}\relax
The Heaviside function is used in the implementation of the skew
Normal, Student-t, and Generalized Error distributions, distributions
functions which play an important role in modelling GARCH processes.
\end{Note}
\begin{Author}\relax
Diethelm Wuertz for the Rmetrics \R-port.
\end{Author}
\begin{References}\relax
Weisstein W. (2004);
\emph{http://mathworld.wolfram.com/HeavisideStepFunction.html},
Mathworld.
\end{References}
\begin{SeeAlso}\relax
\code{GarchDistribution},
\code{GarchDistributionFits}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## SOURCE("fSeries1.34B-HeavisideFunction")

## H -
   x = sort(round(c(-1, -0.5, 0, 0.5, 1, 5*rnorm(5)), 2))
   h = H(x)
        
## Sign -
   s = Sign(x)
   
## Delta -
   d = Delta(x)
   
## Boxcar -
   Pi = Boxcar(x)

## ramp - 
   r = Ramp(x)
   cbind(x = x, Step = h, Signum = s, Delta = d, Pi = Pi, R = r)                
\end{ExampleCode}
\end{Examples}

