| 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: | 2026-05-21 06:58:46 UTC |
| Source: | https://github.com/x0range/finity |
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>.
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 . Given this sample, the finiteness or infiniteness of any moment of order of distribution can be ascertained. For this, the test follows a randomised testing procedure with artificial randomness. The absolute sample moment of the desired order of the sample is transformed into a test statistic, which follows a distribution with one degree of freedom exactly if the moment of the same order of 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 of may be infinite, the sample moment 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 of the original distribution is not finite.
The test works as follows: A standard normal distribution is rescaled with , 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 . The resulting binary quantity (0, or 1, true or false) follows a Bernoulli distribution with mean 1/2 exactly if the th moment of is infinite. Otherwise the mean is not 1/2. Sampling a number of different intervals characterized by different bounds drawn from a distribution with finite support, the test aggregates over quantities such that the resulting test statistic follows a exactly if , i.e., if the th moment of 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().
Torsten Heinrich [aut, cre], Julian Winkler [aut]
Maintainer: Torsten Heinrich <[email protected]>
Trapani, Lorenzo (2016), 'Testing for (in)finite moments', Journal of Econometrics 191(1), 57 – 68.
https://github.com/x0range/finity
# 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# 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