dhgld: The Hurdle Generalized Lambda Distribution Family

Description Usage Arguments Details Value References Examples

View source: R/dhgld.R

Description

Density of the Hurdle Generalized Lambda Distribution.

Usage

1
2
dhgld(x, mixture = FALSE, lambda1, lambda2 = NULL, prob = NULL,
  param = "fmkl", inverse.eps = 1e-08, max.iterations = 500)

Arguments

x

Vector of data.

mixture

Whether to give the density of a mixture of HGLDs.

lambda1

A vector of length 5 with the five parameters of the HGLD, or of the first HGLD if mixture = TRUE.

lambda2

A vector of length 4 with the four parameters of the second HGLD if mixture = TRUE.

prob

The cluster parameter (probability) for the mixture of HGLDs.

param

"fmkl" or "rs".

inverse.eps

Accuracy of calculation for the numerical determination of F(x), defaults to 1e-8.

max.iterations

Maximum number of iterations in the numerical determination of F(x), defaults to 500.

Details

If the parametrization of the RS or FMKL HGLD is not acceptable, the function returns NA. This function is based on the GLDEX package.

Value

The probability density of the continuous part of the HGLD.

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

Su, S.; Fitting Single and Mixture of Generalized Lambda Distributions to Data via Discretized and Maximum Likelihood Methods: GLDEX in R. (2007), Journal of Statistical Software: *21* 9.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(ggplot2)
{ggplot(data.frame(x = seq(-3,1,0.01)),aes(x = x)) +
stat_function(fun = function(x) dhgld(x = x,
                                     lambda1 = c(0.48,0.509,-0.000369,-0.0002483,-0,0003916),
                                     param = "rs"))}

#mixture
lambda1 <- c(0.230,0.3514,-0.4472,-0.374,-0.3108)
lambda2 <- c(9.624,-1.227,-0.629,-0.8515)
{ggplot(data.frame(x = seq(-10,20,0.25)),aes(x = x)) +
stat_function(fun = function(x) dhgld(x = x,mixture = TRUE,lambda1 = lambda1,
lambda2 = lambda2,prob = 0.47954,param = "rs"))}

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