momChangeAbout function

Obtain Moments About a New Location

Obtain Moments About a New Location

Using the moments up to a given order about one location, this function either returns the moments up to that given order about a new location as a vector or it returns a moment of a specific order defined by users (order <= maximum order of the given moments) about a new location as a single number. A generalization of using raw moments to obtain a central moment or using central moments to obtain a raw moment.

momChangeAbout(order = "all", oldMom, oldAbout, newAbout)

Arguments

  • order: One of:

    • the character string "all", the default;
    • a positive integer less than the maximum order of oldMom.
  • oldMom: Numeric. Moments of orders 1, 2, ..., about the point oldAbout.

  • oldAbout: Numeric. The point about which the moments oldMom have been calculated.

  • newAbout: Numeric. The point about which the desired moment or moments are to be obtained.

Details

Suppose mkm_k denotes the kk-th moment of a random variable XX about a point aa, and mkm_k^*

denotes the kk-th moment about bb. Then mkm_k^* may be determined from the moments m1,m2,...,mkm_1,m_2,...,m_k according to the formula

mk=i=0k(ab)imki m_k^*=\sum_{i=0}^k (a-b)^i m^{k-i}%m_k^*=sum_{i=0}^k (a-b)^i m^{k-i}

This is the formula implemented by the function momChangeAbout. It is a generalization of the well-known formulae used to change raw moments to central moments or to change central moments to raw moments. See for example Kendall and Stuart (1989), Chapter 3.

Returns

The moment of order order about the location newAbout when order is specified. The vector of moments about the location newAbout from first order up to the maximum order of the oldMom when order

takes the value "all" or is not specified.

References

Kendall, M. G. and Stuart, A. (1969). The Advanced Theory of Statistics, Volume 1, 3rd Edition. London: Charles Griffin & Company.

Author(s)

David Scott d.scott@auckland.ac.nz , Christine Yang Dong c.dong@auckland.ac.nz

Examples

### Gamma distribution k <- 4 shape <- 2 old <- 0 new <- 1 sampSize <- 1000000 ### Calculate 1st to 4th raw moments m <- numeric(k) for (i in 1:k){ m[i] <- gamma(shape + i)/gamma(shape) } m ### Calculate 4th moment about new momChangeAbout(k, m, old, new) ### Calculate 3rd about new momChangeAbout(3, m, old, new) ### Calculate 1st to 4th moments about new momChangeAbout(oldMom = m, oldAbout = old, newAbout = new) momChangeAbout(order = "all", m, old, new) ### Approximate kth moment about new using sampling x <- rgamma(sampSize, shape) mean((x - new)^k)
  • Maintainer: David Scott
  • License: GPL (>= 2)
  • Last published: 2025-03-29

Useful links