# Testing for finite expectation

The mean of a positive random variable $$X$$ is either finite or infinite; define $$J(X)$$ to be $$0$$ in the former case and $$1$$ in the latter case. Claim: there does not exist a function $$J_n$$ from the iid sample of size $$n$$ to $$\{0,1\}$$ such that $$J_n\to J(X)$$ in probability.

This claim (which is undoubtedly true) appears to be folklore knowledge among statisticians, but I have not been able to find a formal proof in the literature. The closest result I could find is the one by Hawkins, which proves the impossibility of a sequential test with finite stopping time.

Can anyone give a pointer to a book/paper where the folklore claim is formally proven?

• I'm guilty of slightly abusing notation: $J(X)$ is a function of the distribution and hence is a deterministic scalar taking values in $\{0,1\}$. Commented Sep 15, 2020 at 14:40
• $J_n$ is a (possibly randomized) function of the sample, and hence is a random variable. Commented Sep 15, 2020 at 14:41

Example 1 (Finite versus not finite mean). Let $$X$$ be $$X_1, \dots, X_n$$, $$n$$ i.i.d. observations on the real line. As remarked by Bahadur & Savage (1956), "it would be interesting to know whether, in comparable non-parametric situations, tests of the existence of $$\mu$$ are equally unsuccessful"; here, $$\mu$$ refers to the mean of an observation. So, let $$P_0$$ be the family of distributions on the real line with a finite mean, and let $$P_1$$ be the distributions without a finite mean. Condition B readily holds. [...] Hence, the conclusion of theorem 1 holds, and so it is impossible to construct a test with power greater than the size of the test.