File: utils-Heaviside.Rd

package info (click to toggle)
fbasics 4052.98-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,020 kB
  • sloc: ansic: 738; makefile: 14
file content (93 lines) | stat: -rw-r--r-- 1,916 bytes parent folder | download | duplicates (2)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
\name{Heaviside}
\alias{Heaviside}

\alias{Sign}
\alias{Delta}
\alias{Boxcar}
\alias{Ramp}


\title{Heaviside and related functions}

\description{

  Functions which compute the Heaviside and related functions. These
  include the Heaviside function, the sign function, the delta
  function, the boxcar function, and the ramp function.
    
}

\usage{
Heaviside(x, a = 0)
Sign(x, a = 0)
Delta(x, a = 0)
Boxcar(x, a = 0.5)
Ramp(x, a = 0)
}

\arguments{
  \item{x}{
    a numeric vector.
  }
  \item{a}{
    a numeric value, the location of the break.
  }
}

\details{

  \code{Heaviside}  computes the Heaviside unit step function. 
  \code{Heaviside} is 1 for \code{x > a}, 
  \code{1/2} for \code{x = a}, and \code{0} for \code{x < a}.
    
  \code{Sign} computes
  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}.
    
  \code{Delta} computes the delta function.
  \code{Delta} is defined as: \code{Delta(x) = d/dx H(x-a)}.
    
  \code{Boxcar} computes the boxcar function.
  \code{Boxcar} is defined as: \code{Boxcar(x) = H(x+a) - H(x-a)}.
    
  \code{Ramp} computes ramp function. 
  The ramp function is defined as: \code{Ramp(x) = (x-a) * H(x-a)}.
    
}

\value{
  numeric vector
}

\note{

  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.
    
}

\seealso{
  \code{GarchDistribution},
  \code{GarchDistributionFits}
}

\references{
Weisstein W. (2004);
    \emph{http://mathworld.wolfram.com/HeavisideStepFunction.html},
    Mathworld.
}

\examples{
x <- sort(round(c(-1, -0.5, 0, 0.5, 1, 5*rnorm(5)), 2))

h <- Heaviside(x)
s <- Sign(x)
d <- Delta(x)
Pi <- Boxcar(x)
r <- Ramp(x)

cbind(x = x, Step = h, Signum = s, Delta = d, Pi = Pi, R = r)        
}

\keyword{math}