Moment - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Student[Statistics]

  

Moment

  

compute moments

 

Calling Sequence

Parameters

Description

Computation

Examples

References

Compatibility

Calling Sequence

Moment(A, n, numeric_option, origin_option)

Moment(M, nn, numeric_option, origin_option)

Moment(X, n, numeric_option, origin_option, inert_option)

Parameters

A

-

data sample

M

-

Matrix data sample

X

-

algebraic; random variable

n

-

algebraic; order

nn

-

algebraic, list or Vector of algebraic constants; order, or sequence of orders

numeric_option

-

(optional) equation of the form numeric=value where value is true or false

origin_option

-

(optional) equation of the form origin=algebraic where algebraic is a algebraic expression or a list or Vector of algebraic expressions.

inert_option

-

(optional) equation of the form inert=value where value is true or false

Description

• 

The Moment function computes the moment of order n of the specified random variable or data sample.

• 

The first parameter can be a data sample (e.g., a Vector), a Matrix data sample, a random variable, or an algebraic expression involving random variables (see Student[Statistics][RandomVariable]).

• 

The second parameter can be any algebraic expression.

• 

origin=algebraic -- By default, the moment is computed about 0. If this option is present, the moment will be calculated about the specified point. If A is a Matrix data sample, then you can specify several origins instead, one for each column of the Matrix. This is accomplished by passing a list or Vector as the value of the origin option.

• 

If the option inert is not included or is specified to be inert=false, then the function will return the actual value of the result. If inert or inert=true is specified, then the function will return the formula of evaluating the actual value.

Computation

• 

By default, all computations involving random variables are performed symbolically (see option numeric).

• 

If there are floating point values or the option numeric is included, then the computation is done in floating point. Otherwise the computation is exact.

• 

By default, the moment is computed according to the rules mentioned above. To always compute the moment numerically, specify the numeric or numeric = true option.

Examples

withStudentStatistics:

Compute the fourth moment of the beta distribution with parameters 4 and 7.

MomentBetaRandomVariable4,7,4

5143

(1)

MomentBetaRandomVariable4,7,4,numeric

0.03496503497

(2)

MomentBetaRandomVariable4,7,2,origin=12

5132

(3)

MomentBetaRandomVariable4,7,2,origin=12,numeric

0.03787878788

(4)

Use named value for second parameter or origin option.

MomentBetaRandomVariable4,7,a,origin=1

5040−1aa+78+a9+aa+10

(5)

MomentBetaRandomVariable4,7,2,origin=b

533811b+b2

(6)

Use the inert option.

MomentBetaRandomVariable4,7,2,origin=12,inert

01840_t1122_t131_t16ⅆ_t1

(7)

evalfMomentBetaRandomVariable4,7,2,origin=12,inert

0.03787878788

(8)

Create a exponential-distributed random variable X and compute the third moment of 1X+2.

XExponentialRandomVariable2:

Moment1X+2,3,numeric

0.03727171015

(9)

Compute the second moment of the following data, and set the origin to be 3.

A0,2,3,5,2,π,2,4,ln2

A02352π2−4ln2

(10)

MomentA,2,origin=3

659+π329+ln2329

(11)

Consider the following Matrix data sample.

MMatrix3,π,114,5.0,3,12,ln4,ln5,88,2,5,54,4.2,23,17

M3π1145.03−122ln2ln58825544.22317

(12)

Compute the second moment of each of the columns.

MomentM,2

11.512362415635+π25+ln525240895

(13)

Compute the second moment of each column with origin 3.

MomentM,2,origin=3

1.8088091784045+π325+ln5325225685

(14)

Compute the moment of each column with corresponding order and origin.

MomentM,2,3,1,origin=3,100,85

1.80880917822265815+π10035+ln5100351645

(15)

References

  

Stuart, Alan, and Ord, Keith. Kendall's Advanced Theory of Statistics. 6th ed. London: Edward Arnold, 1998. Vol. 1: Distribution Theory.

Compatibility

• 

The Student[Statistics][Moment] command was introduced in Maple 18.

• 

For more information on Maple 18 changes, see Updates in Maple 18.

See Also

Statistics[Moment]

Student

Student[Statistics]

Student[Statistics][RandomVariable]