continuous {smovie} | R Documentation |
Univariate Continuous Distributions: p.d.f and c.d.f.
Description
A movie to illustrate how the probability density function (p.d.f.) and cumulative distribution function (c.d.f.) of a continuous random variable depend on the values of its parameters.
Usage
continuous(
distn,
var_range = NULL,
params = list(),
param_step = list(),
param_range = list(),
p_vec = NULL,
smallest = 0.01,
plot_par = list(),
panel_plot = TRUE,
hscale = NA,
vscale = hscale,
...
)
Arguments
distn |
Either a character string or a function to choose the continuous random variable. Strings Valid functions are set up like a standard distributional function
If |
var_range |
A numeric vector of length 2. Can be used to set a fixed
range of values over which to plot the p.d.f. and c.d.f., in order better
to see the effects of changing the parameter values.
If |
params |
A named list of initial parameter values with which to start
the movie. If If If parameter value is outside the corresponding range specified by
|
param_step |
A named list of the amounts by which the respective
parameters in |
param_range |
A named list of the ranges over which the respective
parameters in |
p_vec |
A numeric vector of length 2. The p.d.f. and c.d.f. are
plotted between the 100 |
smallest |
A positive numeric scalar. The smallest value to be
used for any strictly positive parameters when |
plot_par |
A named list of graphical parameters
(see |
panel_plot |
A logical parameter that determines whether the plot
is placed inside the panel ( |
hscale , vscale |
Numeric scalars. Scaling parameters for the size
of the plot when |
... |
Additional arguments to be passed to
|
Details
The movie starts with a plot of the p.d.f. of the distribution for the initial values of the parameters. Buttons increase (+) or decrease (-) each parameter. There are radio buttons to switch the plot from the p.d.f. to the c.d.f. and back.
Value
Nothing is returned, only the animation is produced.
See Also
movies
: a user-friendly menu panel.
smovie
: general information about smovie.
Examples
# Normal example
continuous()
# Fix the range of values over which to plot
continuous(var_range = c(-10, 10))
# The same example, but using a user-supplied function and setting manually
# the initial parameters, parameter step size and range
continuous(distn = dnorm, params = list(mean = 0, sd = 1),
param_step = list(mean = 1, sd = 1),
param_range = list(sd = c(0, NA)))
# Gamma distribution. Show the use of var_range
continuous(distn = "gamma", var_range = c(0, 15))