Package 'finity'

Title: Test for Finiteness of Moments in a Distribution
Description: The purpose of this package is to tests whether a given moment of the distribution of a given sample is finite or not. For heavy-tailed distributions with tail exponent b, only moments of order smaller than b are finite. Tail exponent and heavy- tailedness are notoriously difficult to ascertain. But the finiteness of moments (including fractional moments) can be tested directly. This package does that following the test suggested by Trapani (2016) <doi:10.1016/j.jeconom.2015.08.006>.
Authors: Torsten Heinrich [aut, cre], Julian Winkler [aut]
Maintainer: Torsten Heinrich <[email protected]>
License: GPL (>= 2)
Version: 0.1.5
Built: 2024-10-23 04:14:09 UTC
Source: https://github.com/x0range/finity

Help Index


Test for Finiteness of Moments in a Distribution

Description

The purpose of this package is to tests whether a given moment of the distribution of a given sample is finite or not. For heavy-tailed distributions with tail exponent b, only moments of order smaller than b are finite. Tail exponent and heavy- tailedness are notoriously difficult to ascertain. But the finiteness of moments (including fractional moments) can be tested directly. This package does that following the test suggested by Trapani (2016) <doi:10.1016/j.jeconom.2015.08.006>.

Details

The main function of the package, which performs the test for the finiteness of moments, is

finite_moment_test().

The test assumes a sample drawn from an unknown distrubution FF. Given this sample, the finiteness or infiniteness of any moment of order kk of distribution FF can be ascertained. For this, the test follows a randomised testing procedure with artificial randomness. The absolute sample moment μk\mu_k of the desired order kk of the sample is transformed into a test statistic, which follows a χ2\chi^2 distribution with one degree of freedom exactly if the moment of the same order kk of FF is not finite. The null hypothesis in the test is that the moment is infinite; the alternative is that it is finite.

It should be noted that while the moment of order kk of FF may be infinite, the sample moment μk\mu_k is always finite because the sample is of finite size. The sample moment will, however, diverge with growing sample size if the moment of the same order kk of the original distribution FF is not finite.

The test works as follows: A standard normal distribution is rescaled with exp(μk)\sqrt{\exp(\mu_k)}, yielding a normal distribution with mean 0 and either finite or infinite variance, depending on whether the hypothesis holds. For every observation of the resulting distribution, it is then tested, if the observation is located within an interval [u,u][-u, u]. The resulting binary quantity ζ\zeta (0, or 1, true or false) follows a Bernoulli distribution with mean 1/2 exactly if the kkth moment of FF is infinite. Otherwise the mean is not 1/2. Sampling a number of different intervals characterized by different bounds uu drawn from a distribution with finite support, the test aggregates over quantities ζ\zeta such that the resulting test statistic follows a χ2\chi^2 exactly if E(ζ)=1/2E(\zeta)=1/2, i.e., if the kkth moment of FF is infinite.

Trapani (2016) offers some insights into the performance of the test and the impact its parameters have. These parameters are optional arguments of the testing function finite_moment_test().

Author(s)

Torsten Heinrich [aut, cre], Julian Winkler [aut]

Maintainer: Torsten Heinrich <[email protected]>

References

Trapani, Lorenzo (2016), 'Testing for (in)finite moments', Journal of Econometrics 191(1), 57 – 68.

See Also

https://github.com/x0range/finity

Examples

# Generate sample
rvs <- stabledist::rstable(100000, 1.9, 0.5, 1, 0, pm = 0)
# Perform test
result <- finite_moment_test(rvs, 2)
# Print results
message(paste("Test statistic:", result[1], "p-value:", result[2], "\n\n"))

# More examples are included in https://github.com/x0range/finity/examples