plot.fit.hgld: Plot the Hurdle Generalized Lambda Distribution

Description Usage Arguments Details Value References Examples

View source: R/plot.fit.hgld.R

Description

Density plot of the fit given by an object of class fit.hgld.

Usage

1
2
3
4
## S3 method for class 'fit.hgld'
plot(x, histogram = TRUE, hcolor = "white",
  hfill = "black", bins = 50, dcolor = c("black", "red"),
  dtype = c("solid", "solid"), xlab = "Data", ylab = "Density", ...)

Arguments

x

A fit.hgld object.

histogram

Logical. Whether the estimated density must be superimposed by the data histogram.

hcolor

Color of the histogram.

hfill

Color to fill the histogram.

bins

Number of histogram bins.

dcolor

Color of the RS and fmkl density plot.

dtype

Type of the RS and fmkl density line.

xlab

Label of the x-axis.

ylab

Label of the y-axis.

...

Arguments to be passed to methods.

Details

The density may be plotted by itself or superimposed by the data histogram. Plot only the non-zero data values.

Value

RS

ggplot plot of the fitted RS GLD.

fmkl

ggplot plot of the fitted fmkl GLD.

RF

ggplot plot of the fitted RS and fmkl GLD on the same plot.

References

Marcondes, D.; Peixoto, C.; Maia, A. C.; A Survey of a Hurdle Model for Heavy-Tailed Data Based on the Generalized Lambda Distribution. (2017) arxiv1712.02183

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
set.seed(100)
data <- healthcare[sample(1:nrow(healthcare),50),]
fit <- fit.hgld(data$log_expense)
plot(fit)

#mixture
set.seed(100)
data <- c(rcauchy(20,location = 10),rep(0,10),rcauchy(20))
fit <- fit.hgld(data = data,mixture = TRUE)
plot(fit)

dmarcondes/HGLD documentation built on May 28, 2019, 12:56 p.m.