Description Usage Arguments Details Value See Also Examples
View source: R/poisson_process_check_movie.R
A movie to perform informal graphical checks of whether event arrival times are consistent with arising from a (one-dimensional, homogeneous) Poisson process.
1 2 | poisson_process_check(user_data = NULL, total_time = NULL,
intervals = 1, unif_bins = NULL, exp_bins = NULL)
|
user_data |
A numeric vector of arrival times of events. |
total_time |
A positive numeric scalar. The number of time units
(for example hours) over which the events in |
intervals |
An integer scalar. Must not be smaller than 1.
The number of intervals into which to split the time interval
(0, |
unif_bins |
A positive integer scalar. The number of bins to use in
the histogram in the "times at which events occur" described in
Details. If this is not supplied then the default
number of bins used in |
exp_bins |
A positive integer scalar. The number of bins to use in
the histogram in the "times between events" described in
Details. If this is not supplied then the default
number of bins used in |
This movie contains two displays of plots: one plot on the top and
one of three other plots on the bottom. The rate, λ say, of
the supposed Poisson process is estimated by the sample mean number of
events over the n_intervals
, that is,
length(user_data)
/ intervals
. Let's call this estimate
m.
The type of plot that appears in the bottom of the display depends on the radio click by the user. The choices are
"none" Nothing is plotted
"numbers of events in each hour" A barplot (the red bars) giving the proportions of the hours for which there are 0, 1 , 2, ... events. Also included are black bars showing the p.m.f. of a Poisson(m) random variable.
"times between events" A histogram (with red rectangles) of the sample times between events, with the p.d.f. of an exponential(m) random variable superimposed.
"times at which events occur" A histogram (with red rectangles)
of the simulated event times, with the p.d.f. of a
uniform(0, hours
) random variable superimposed.
The type of plot can be changed by clicking on the appropriate radio button.
Nothing is returned, only the animation is produced.
movies
: general information about the movies.
poisson_process_movie
: for similar plots based on
data simulated from a Poisson process.
1 2 3 4 5 6 7 8 9 10 | # Load package rpanel
# [Use install.packages("rpanel") if necessary]
library(rpanel)
# Data in which an event occurs exactly on the hour
## Not run:
poisson_process_check(user_data = (1:24), 24, 24)
poisson_process_check(user_data = (1:24), 24, 24, exp_bins = 100)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.