momentList: Class momentList

Description Usage Arguments Details

View source: R/momentList.R

Description

Create and validate objects of class momentList. Class momentList is needed as argument for function transformMoment. The returned value of transformMoment is of class momentList, too. The class provides a convenient structure to store moments of a multidimensional distribution.

Class momentList consists of four elements: Element centralMoments contains all known central moments of the distribution, where as rawMoments contains all raw moments of the distribution. Both are stored as list. The elements centralMomentOrders and rawMomentOrders contain the corresponding orders of the moments. They are stored as matrix or data.frame, each row represents one order of the moment. The number of columns of these matrices should be equal to the dimension of the distribution.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
new_momentList(rawMomentOrders = NULL, rawMoments = list(),
  centralMomentOrders = NULL, centralMoments = list())

momentList(rawMomentOrders = NULL, rawMoments = list(),
  centralMomentOrders = NULL, centralMoments = list(),
  warnings = TRUE, replace = FALSE)

validate_momentList(x, warnings = TRUE, replace = FALSE)

extractMean(x, ...)

extractCov(x)

Arguments

rawMomentOrders

matrix or data.frame. Every row gives the order of a raw moment that is already known.

rawMoments

list. The i-th entry is the raw Moment of order rawMomentOrders[i, ].

centralMomentOrders

matrix or data.frame. Every row gives the order of a central moment that is already known.

centralMoments

list. The i-th entry is the central Moment of order centralMomentOrders[i, ].

warnings

bool. If FALSE, warnings about moments of order 0 and 1 will be suppressed.

replace

bool. If TRUE, inconvenient values of moments of order 0 and 1 will be replaced by convenient ones.

x

object of class momentList

...

additional arguments to function mean. They are currently not used.

Details

There are five different functions available for this class:
Function new_momentList is a low level constructor that does not check for correct types of the arguments or if they fit together. It should be only used with care.
Function momentList creates an object of class momentList and performs various checks on the elements. Most of them are executed within function validate_momentList. This function particularly checks for moments of order one and zero. If they contain false values, a warning will be thrown. If moments of these orders are not contained in momentList, they are added automatically.
The functions extractMean and extractCov pick the means or covariances out of momentList in case they exist. Function extracCov may transform raw moments of order two into covariances, if the corresponding central moments are not given.


CharlotteJana/momcalc documentation built on Oct. 17, 2019, 7:21 a.m.