Learn R Programming

lmomco (version 2.4.14)

pdfpdq4: Probability Density Function of the Polynomial Density-Quantile4 Distribution

Description

This function computes the probability density of the Polynomial Density-Quantile4 distribution given parameters (\(\alpha\) and \(\beta\)) computed by parpdq4. The probability density function has not explicit form. The implementation here simply uses a five-point stencil to approciate the derivative of the cumulative distribution function cdfpdq4 and hence an eps term is used and multipled to the scale parameter (\(\alpha\)) of the distribution. The distribution's canonical definition is in terms of the quantile function (quapdq4).

Usage

pdfpdq4(x, para, paracheck=TRUE, h=NA, hfactor=0.2)

Value

Probability density (\(f\)) for \(x\).

Arguments

x

A real value vector.

para

The parameters from parpdq4 or vec2par.

paracheck

A logical switch as to whether the validity of the parameters should be checked. Default is paracheck=TRUE. This switch is made so that the root solution needed for cdfpdq4 shows an extreme speed increase because of the repeated calls to quapdq4.

h

The differential element of the stencil, if provided, otherwise hfactor used.

hfactor

A term multiplied to the \(\alpha\) parameter to set the \(h\) in the numerical derivative. Not optimal, but seems to work for a variety of chosen parameters for plotting the density function.

Author

W.H. Asquith

References

Hosking, J.R.M., 2007, Distributions with maximum entropy subject to constraints on their L-moments or expected order statistics: Journal of Statistical Planning and Inference, v. 137, no. 9, pp. 2870--2891, tools:::Rd_expr_doi("10.1016/j.jspi.2006.10.010").

See Also

cdfpdq4, quapdq4, lmompdq4, parpdq4

Examples

Run this code
if (FALSE) {
  para <- list(para=c(0, 0.4332, -0.7029), type="pdq4")
  X <- seq(-4, +4, by=(4 - -4) / 1000)
  plot( X, pdfpdq4(X, para), type="l", col=grey(0.8), lwd=4, ylim=c(0, 0.5))
  lines(X, dnorm(  X, sd=1), lty=2)
  legend("topleft", c("Standard normal distribution",
                      "PDQ4 distribution with same L-moments as the standard normal"),
                    lwd=c(1, 4), lty=c(2, 1), col=c(1, grey(0.8)), cex=0.8)
  mtext("Mimic Hosking (2007, fig. 3 [left])")
  check.pdf(pdfpdq4, para, hfactor=0.3) }

if (FALSE) {
  para <- list(para=c(100, 43.32, -0.7029), type="pdq4")
  minX <- quapdq4(0.0001, para)
  maxX <- quapdq4(0.9999, para)
  X <- seq(minX, maxX, by=(maxX - minX) / 1000)
  plot( X, pdfpdq4(X, para), type="l", col=grey(0.8), lwd=4)

  check.pdf(pdfpdq4, para, hfactor=0.3) }

Run the code above in your browser using DataLab