Navigation

Operators and Keywords

Function List:

C++ API

: moment (x, p)
: moment (x, p, type)
: moment (x, p, dim)
: moment (x, p, type, dim)
: moment (x, p, dim, type)

Compute the p-th central moment of the vector x.

1/N SUM_i (x(i) - mean(x))^p

If x is a matrix, return the row vector containing the p-th central moment of each column.

If the optional argument dim is given, operate along this dimension.

The optional string type specifies the type of moment to be computed. Valid options are:

"c"

Central Moment (default).

"a"
"ac"

Absolute Central Moment. The moment about the mean ignoring sign defined as

1/N SUM_i (abs (x(i) - mean(x)))^p
"r"

Raw Moment. The moment about zero defined as

moment (x) = 1/N SUM_i x(i)^p
"ar"

Absolute Raw Moment. The moment about zero ignoring sign defined as

1/N SUM_i ( abs (x(i)) )^p

If both type and dim are given they may appear in any order.

See also: var, skewness, kurtosis.

Package: octave