pdfpe3: Probability Density Function of the Pearson Type III...

pdfpe3R Documentation

Probability Density Function of the Pearson Type III Distribution

Description

This function computes the probability density of the Pearson Type III distribution given parameters (\mu, \sigma, and \gamma) computed by parpe3. These parameters are equal to the product moments (pmoms): mean, standard deviation, and skew. The probability density function for \gamma \ne 0 is

f(x) = \frac{Y^{\alpha -1} \exp({-Y/\beta})} {\beta^\alpha\, \Gamma(\alpha)} \mbox{,}

where f(x) is the probability density for quantile x, \Gamma is the complete gamma function in R as gamma, \xi is a location parameter, \beta is a scale parameter, \alpha is a shape parameter, and Y = x - \xi for \gamma > 0 and Y = \xi - x for \gamma < 0. These three “new” parameters are related to the product moments (\mu, mean; \sigma, standard deviation; \gamma, skew) by

\alpha = 4/\gamma^2 \mbox{,}

\beta = \frac{1}{2}\sigma |\gamma| \mbox{,\ and}

\xi = \mu - 2\sigma/\gamma \mbox{.}

If \gamma = 0, the distribution is symmetrical and simply is the probability density Normal distribution with mean and standard deviation of \mu and \sigma, respectively. Internally, the \gamma = 0 condition is implemented by R function dnorm. The PearsonDS package supports the Pearson distribution system including the Type III (see Examples).

Usage

pdfpe3(x, para)

Arguments

x

A real value vector.

para

The parameters from parpe3 or vec2par.

Value

Probability density (f) for x.

Author(s)

W.H. Asquith

References

Hosking, J.R.M., 1990, L-moments—Analysis and estimation of distributions using linear combinations of order statistics: Journal of the Royal Statistical Society, Series B, v. 52, pp. 105–124.

Hosking, J.R.M., and Wallis, J.R., 1997, Regional frequency analysis—An approach based on L-moments: Cambridge University Press.

See Also

cdfpe3, quape3, lmompe3, parpe3

Examples

  lmr <- lmoms(c(123,34,4,654,37,78))
  pe3 <- parpe3(lmr)
  x <- quape3(0.5,pe3)
  pdfpe3(x,pe3)
## Not run: 
# Demonstrate Pearson Type III between lmomco and PearsonDS
qlmomco.pearsonIII <- function(f, para) {
   MU    <- para$para[1] # product moment mean
   SIGMA <- para$para[2] # product moment standard deviation
   GAMMA <- para$para[3] # product moment skew
   L <- para$para[1] - 2*SIGMA/GAMMA # location
   S <- (1/2)*SIGMA*abs(GAMMA)       # scale
   A <- 4/GAMMA^2                    # shape
   return(PearsonDS::qpearsonIII(f, A, L, S)) # shape comes first!
}
FF <- nonexceeds(); para <- vec2par(c(6,.4,.7), type="pe3")
plot( FF, qlmomco(FF, para), xlab="Probability", ylab="Quantile", cex=3)
lines(FF, qlmomco.pearsonIII(FF, para), col=2, lwd=3) # 
## End(Not run)

## Not run: 
# Demonstrate forced Pearson Type III parameter estimation via PearsonDS package
para <- vec2par(c(3, 0.4, 0.6), type="pe3"); X <- rlmomco(105, para)
lmrpar <- lmom2par(lmoms(X), type="pe3")
mpspar <- mps2par(X, type="pe3"); mlepar <- mle2par(X, type="pe3")
PDS <- PearsonDS:::pearsonIIIfitML(X) # force function exporting
if(PDS$convergence != 0) {
  warning("convergence failed"); PDS <- NULL # if null, rerun simulation [new data]
} else {
  # This is a list() mimic of PearsonDS::pearsonFitML()
  PDS   <- list(type=3, shape=PDS$par[1], location=PDS$par[2], scale=PDS$par[3])
  skew  <- sign(PDS$shape) * sqrt(4/PDS$shape)
  stdev <-    2*PDS$scale  / abs(skew); mu <- PDS$location + 2*stdev/skew
  PDS <- vec2par(c(mu,stdev,skew), type="pe3") # lmomco form of parameters
}
print(lmrpar$para); print(mpspar$para); print(mlepar$para); print(PDS$para)
#        mu     sigma     gamma
# 2.9653380 0.3667651 0.5178592 # L-moments (by lmomco, of course)
# 2.9678021 0.3858198 0.4238529 # MPS by lmomco
# 2.9653357 0.3698575 0.4403525 # MLE by lmomco
# 2.9653379 0.3698609 0.4405195 # MLE by PearsonDS
# So we can see for this simulation that the two MLE approaches are similar.
## End(Not run)

lmomco documentation built on May 29, 2024, 10:06 a.m.