rglindley: Random Generator of a Generalized Lindley Distribution

View source: R/rglindley.R

Random Generalized Lindley DistributionR Documentation

Random Generator of a Generalized Lindley Distribution

Description

Generates random samples of a univariate Generalizeed Lindley Distribution.

Usage

 rglindley(n, alpha, beta, gamma, plot.it = TRUE, empirical = FALSE, 
           col.pop = "red3", col.empirical = "navy", ...)

Arguments

n

number of observations.

alpha

vector of parameters.

beta

vector of parameters.

gamma

vector of parameters.

plot.it

logical; if TRUE (default), plot the histogram with estimated distribution curve.

empirical

logical; if TRUE, add the empirical curve ("Kernel Density Estimation") in the plot.

col.pop

a colour to be used in the curve of population density.

col.empirical

a colour to be used in the curve of empirical density.

...

further arguments and graphical parameters passed to hist.

Author(s)

CASTRO, M. O.; MONTALVO, G. S. A.

Examples

## Generate a sample.
data = rglindley(n = 1000, alpha = 6, beta = 3, gamma = 2)

## Sample vector.
data$sample
## The histogram of the sample with population density curve.
data$plot

## Not plotting the graphic.
rglindley(n = 1000, alpha = 6, beta = 3, gamma = 2, plot.it = FALSE)

## Adding the empirical curve to the graphic.
rglindley(n = 1000, alpha = 6, beta = 3, gamma = 2, plot.it = TRUE, 
          empirical = TRUE)

## Changing the color of the curves.
rglindley(n = 1000, alpha = 6, beta = 3, gamma = 2, plot.it = TRUE, 
          empirical = TRUE, col.pop = "blue", col.empirical = "green")

## Using "...".
rglindley(n = 1000, alpha = 6, beta = 3, gamma = 2, breaks = 300)

matheuscastro43/finiteMix documentation built on March 30, 2022, 12:49 p.m.