Can we show equivalence of two distributions based on their statistics?

Let $$p,q$$ be two distributions on $$\mathbb{R}^d$$. Let $$f:\mathbb{R}^d\times\mathbb{R}^d\rightarrow\mathbb{R}$$. Under what conditions does $$\mathbb{E}_{x\sim p}f(x,z)=\mathbb{E}_{x\sim q}f(x,z)\ \forall z\in\mathbb{R}^d$$ indicate $$p=q$$ a.e.? For example, can we prove $$p=q$$ a.e. when $$f(x,z)=\tanh(x^{\top}z)$$?

(Note: this problem may be related to discriminatory functions such as sigmoidal functions, but two distributions are involved in this case.)

• So with that $f$ and with $d=1$, this is asking: if for all $z$, $$\int (p(x)-q(x))\tanh(xz)\, dx =0,$$ does it follow that $p=q$ as distributions? – Matt F. Oct 10 at 3:28
• This is related to the moment problem. You need really strong conditions on $f$ and the space of possible distributions. – Christian Chapman Oct 10 at 3:29
• @ChristianChapman, it is related but the moment problem is usually about only moments from integer powers, and the analog here would be asking whether distributions are determined by their moments from non-integer powers as well. Eg in the standard example (link.springer.com/content/pdf/10.1007%2F978-1-4419-5823-5_6.pdf) the lognormal and its perturbation only agree on moments for integral powers. – Matt F. Oct 10 at 3:35
• The answer to Matt's version (his comment above) is clearly no since $\tanh xz$ is odd, so the integral will be zero for all $z$ as soon as $p-q$ is even (so in particular, for any two even $p,q$). – Christian Remling Oct 10 at 14:45
• I found a useful material. See Lemma 1 in jmlr.org/papers/volume13/gretton12a/gretton12a.pdf – Zhifeng Kong Oct 11 at 4:10