transformMoment: Transform raw moments into central moments and vice versa

Description Usage Arguments Value

View source: R/transformMoment.R

Description

Let X be a random variable and Y the corresponding centered variable, i.e. Y = X - μ. Let p be the order of the desired moment.

If type = 'raw', this function returns

E(X^p) = ∑ choose(p,k)*μ^(p-k)*E(Y^k),

where the sum is taken over any row k in expand.grid(lapply(1:n, function(i) 0:p[i])).

The values of E(Y^k) are replaced by

If type = 'central', this function returns

E(Y^p) = ∑ (-1)^(p-k)*choose(p,k)*μ^(p-k)*E(X^k),

where the sum is taken over any row k in expand.grid(lapply(1:n, function(i) 0:p[i])).

The values of E(X^k) are replaced by

Usage

1
2
transformMoment(order, type, momentList, closure = "zero",
  simplify = TRUE)

Arguments

order

numeric vector giving the order of the desired moment.

type

string, either 'central' or 'raw'.

momentList

object of class momentList.

closure

string giving the closure method to use if a central moment is unknown. Possible values are the same as for argument distribution of symbolicMoments.

simplify

bool indiciating if the resulting expressions should be simplified. Function Simplify from package Deriv is used for simplification.

Value

This function returns an object of class 'momentList'.


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