Learn R Programming

lmomco (version 0.88)

pmoms: The Sample Product Moments: Mean, Standard Deviation, Skew, and Excess Kurtosis

Description

Compute the four sample product moments for a vector.

Usage

pmoms(x)

Arguments

x
A vector of data values.

Value

  • An R list is returned.
  • momentsVector of the product moments. First element is the mean (mean()), second is standard deviation, and the higher values typically are not used, but the ratios[3] and ratios[4] are.
  • ratiosVector of the product moment ratios. Second element is the coefficient of variation, ratios[3] is skew, and ratios[4] is excess kurtosis.
  • unbiased.sdUnbiased standard deviation [well at least unbiased variance (unbiased.sd^2)] computed by Rsd().
  • unbiased.skewUnbiased skew, same as ratios[3].
  • unbiased.kurtosisUnbiased excess kurtosis, same as ratios[4].
  • classical.sdClassical (theoretical) definition of standard deviation.
  • classical.skewClassical (theoretical) definition of skew.
  • classical.kurtosisClassical (theoretical) definition of excess kurtosis
  • messageThe product moments are confusing in terms of definition because they are not naturally unbiased. Your author thinks that it is informative to show the biased versions on the output from the pmoms function. Therefore, this message includes several clarifications of the output.
  • sourceAn attribute identifying the computational source of the product moments: pmoms.

References

Dingman, S.L., 2002, Physical hydrology, 2nd ed: Prentice Hall, Upper Saddle River, NJ, appendix C.

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

See Also

lmoms

Examples

Run this code
# A simple example
PM <- pmoms(rnorm(1000)) # n standard normal values as a fake data set.
cat(c(PM$moments[1],PM$moments[2],PM$ratios[3],PM$ratios[4],""))
# As sample size gets very large the four values returned should be
# 0,1,0,0 by definition of the standard normal distribution.

# A more complex example
para <- vec2par(c(100,500,3),type='pe3') # mean=100, sd=500, skew=3
# The Pearson type III distribution is implemented here such that
# the "parameters" are equal to the mean, standard deviation, and skew.  
simDATA <- rlmomco(100,para) # simulate 100 observations
PM <- pmoms(simDATA) # compute the product moments

p.tmp <- c(PM$moments[1],PM$moments[2],PM$ratios[3])
cat(c("Sample P-moments:",p.tmp,""))
# This distribution has considerable variation and large skew. Stability
# of the sample product moments requires LARGE sample sizes (too large
# for a builtin example)

# Continue the example through the L-moments
lmr <- lmoms(simDATA) # compute the L-moments
epara <- parpe3(lmr) # estimate the Pearson III parameters. This is a
# hack to back into comparative estimates of the product moments. This
# can only be done because we know that the parent distribution is a
# Pearson Type III

l.tmp <- c(epara$para[1],epara$para[2],epara$para[3]) 
cat(c("PearsonIII by L-moments:",l.tmp,""))
# The first values are the means and will be identical and close to 100.
# The second values are the standard deviations and the L-moment to
#   PearsonIII will be closer to 500 than the product moment (this
#   shows the raw power of L-moment based analysis---they work).
# The third values are the skew. Almost certainly the L-moment estimate
#   of skew will be closer to 3 than the product moment.

Run the code above in your browser using DataLab