pdfunc {TSSS} | R Documentation |
Probability Density Function
Description
Evaluate probability density function for normal distribution, Cauchy distribution, Pearson distribution, exponential distribution, Chi-square distributions, double exponential distribution and uniform distribution.
Usage
pdfunc(model = "norm", mean = 0, sigma2 = 1, mu = 0, tau2 = 1, shape,
lambda = 1, side = 1, df, xmin = 0, xmax = 1, plot = TRUE, ...)
Arguments
model |
a character string indicating the model type of probability
density function: either |
mean |
mean. (valid for |
sigma2 |
variance. (valid for |
mu |
location parameter |
tau2 |
dispersion parameter |
shape |
shape parameter (> 0.5). (valid for |
lambda |
lambda |
side |
1: exponential, 2: two-sided exponential.
(valid for |
df |
degree of freedoms |
xmin |
lower bound of the interval. |
xmax |
upper bound of the interval. |
plot |
logical. If |
... |
graphical arguments passed to the |
Value
An object of class "pdfunc"
which has a plot
method. This is a
list with the following components:
density |
values of density function. |
interval |
lower and upper bound of interval. |
param |
parameters of model. |
References
Kitagawa, G. (2020) Introduction to Time Series Modeling with Applications in R. Chapman & Hall/CRC.
Examples
# normal distribution
pdfunc(model = "norm", xmin = -4, xmax = 4)
# Cauchy distribution
pdfunc(model = "Cauchy", xmin = -4, xmax = 4)
# Pearson distribution
pdfunc(model = "Pearson", shape = 2, xmin = -4, xmax = 4)
# exponential distribution
pdfunc(model = "exp", xmin = 0, xmax = 8)
pdfunc(model = "exp", xmin = -4, xmax = 4)
# Chi-square distribution
pdfunc(model = "Chi2", df = 3, xmin = 0, xmax = 8)
# double exponential distribution
pdfunc(model = "dexp", xmin = -4, xmax = 2)
# uniform distribution
pdfunc(model = "unif", xmin = 0, xmax = 1)