TSSS (version 1.3.4-5)

pdfunc: 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, ...)

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.

Arguments

model

a character string indicating the model type of probability density function: either "norm", "Cauchy", "Pearson", "exp", "Chi2", "dexp" or "unif".

mean

mean. (valid for "norm")

sigma2

variance. (valid for "norm")

mu

location parameter \(\mu\). (valid for "Cauchy" and "Pearson")

tau2

dispersion parameter \(\tau^2\). (valid for "Cauchy" and "Pearson")

shape

shape parameter (> 0.5). (valid for "Pearson")

lambda

lambda \(\lambda\). (valid for "exp")

side

1: exponential, 2: two-sided exponential. (valid for "exp")

df

degree of freedoms \(k\). (valid for "Chi2")

xmin

lower bound of the interval.

xmax

upper bound of the interval.

plot

logical. If TRUE (default), probability density function is plotted.

...

graphical arguments passed to the plot method.

References

Kitagawa, G. (2020) Introduction to Time Series Modeling with Applications in R. Chapman & Hall/CRC.

Examples

Run this code
# 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) 

Run the code above in your browser using DataLab