| Intensity | R Documentation |
Estimate and plot the intensity function describing the rate at which a sequence of events occurs over time.
Intensity(x, ...)
## S3 method for class 'Intensity'
plot(x, y = NULL, xlab = NULL, ylab = NULL,
type = "l", zero.line = TRUE, ...)
x |
For For |
y |
Unused. Present to match the signature of the generic |
xlab |
Character label for the horizontal axis. If |
ylab |
Character label for the vertical axis. If |
type |
The type of plot to draw. Defaults to |
zero.line |
Logical. If |
... |
For For |
Intensity estimates the intensity function using a kernel density
estimate (via density) of the numeric representation of the
event times. Because density integrates to one, the estimate is
rescaled by the number of events so that the area under the curve equals the
event count. The resulting height therefore has units of events per unit
time.
Intensity returns an object of class Intensity. This is a
density object whose y values have been rescaled to
integrate to the number of events, and whose x values have been
restored to the class (POSIXt or Date) of the input.
plot.Intensity is called for its side effect, which is to produce a
plot on the current graphics device.
Steven L. Scott steve.the.bayesian@gmail.com
density
## Simulate 500 event times clustered near the middle of a one-year window.
origin <- as.Date("2020-01-01")
event.days <- rnorm(500, mean = 180, sd = 40)
event.times <- origin + event.days
intensity <- Intensity(event.times)
plot(intensity)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.