Learn R Programming

OLCPM (version 0.1.1)

moment.determine: determine the moment (largest) of the data samples

Description

This function reports the largest moment that exists for a collection of data samples.

Usage

moment.determine(x, k.max = 8, alpha = 0.05, R = 400)

Value

an integer, indicating the largest moment that exists for the data samples.

Arguments

x

a numeric vector of data samples.

k.max

a number indicating the upper bound, i.e., at most k.max-th moment exists.

alpha

a number in \((0,1)\), indicating the significance level of the test.

R

the number of standard Gaussian variables generated in the randomized test; see also moment.test.

Author

Yong He, Xinbing Kong, Lorenzo Trapani, Long Yu

Details

The procedure will sequentially test the existence of the \(4th, 6th, 8th, ... k.max-th\) moment, using the function \(moment.test\) in the same package. As soon as the procedure finds that the \(k-th\) moment does not exist, it stops and reports at most \((k-1)-th\) moment.

Examples

Run this code

x=rt(10000,5)
moment.determine(x,10)

x=rt(10000,4)
moment.determine(x,10)


Run the code above in your browser using DataLab