3
$\begingroup$

I am wondering whether or not there is a computationally efficient way to compute the first $N$ moments $$m_k=\sum_{n=1}^{N}p_nx_n^k,\;\;\;\;k=1,...,N$$ of a probability mass function with mass $p_1,...,p_N$ on $N$ points $x_1\leq x_2\leq...\leq x_N$, $x_i\in\mathbb{R}$. By computationally efficient, I mean $O(N\log N)$ complexity or similar. Computing the moments directly gives $O(N^2)$ complexity. Algorithms which return the moments to within a tolerance $\epsilon$, similar to fast multipole methods, would be of interest.

I am particularly interested in the case $-1\leq x_1\leq...\leq x_n\leq 1$. If the $|x_i|$ are uniformly bounded away from 1, then only the first $O(\log N)$ of the $m_k$ are significantly different from 0, since $|x_i^k|\leq \epsilon/N$ for $k\geq C\log N$. Then the interesting moments can be computed in $O(N\log N)$ time. I am wondering what can be said in the general case where $|x_i|$ may be close to 1.

$\endgroup$
1
  • 2
    $\begingroup$ Not sure if this helps, but another way of putting your problem is a fast matrix-vector multiplication $V^\top p$ where $V$ is the Vandermonde matrix of the $x_i$ points, and $p$ is the probability vector. Are there known fast methods for this? $\endgroup$ Commented Jan 14, 2022 at 13:25

2 Answers 2

2
$\begingroup$

In the either the finite or infinite field case this problem can be solved in $O(M(n)\log(n))$ base field operations, where $M(n)$ is the time it takes to multiply polynomials in degree $n$ (so using FFT, this is quasi-linear).

This is in Chapter 3 of Pan's Structured Matrices and Polynomials.

You can adapt this technique here. Since the book is not publicly available I have some screenshots below:

here

here

here

$\endgroup$
1
  • $\begingroup$ Thank you and also @JukkaKohonen, this is exactly what I was looking for (with the Vandermonde transpose vs. the Vandermonde matrix itself). Some more discussion on this problem is also in mathoverflow.net/q/72341. $\endgroup$ Commented Jan 16, 2022 at 23:53
2
$\begingroup$

Here's a bit more direct way than with Vandermonde transpose. Consider the generating function

$$ f(x) = \sum\limits_{k=0}^\infty m_k x^k $$

It rewrites as

$$ f(x) = \sum\limits_{k=0}^\infty \sum\limits_{n=1}^N p_n (x_n x)^k = \sum\limits_{n=1}^N p_n \sum_{k=0}^\infty (x_n x)^k = \sum\limits_{n=1}^N \frac{p_n}{1-x_n x}. $$

This sum can be computed as $\frac{P(x)}{Q(x)}$ in $O(M(N) \log N)$ with divide and conquer algorithm.

Then one can compute the first $N$ coefficients of $\frac{P(x)}{Q(x)}$ as

$$ m_0 + m_1 x + \dots + m_N x^N \equiv P(x) Q(x)^{-1} \pmod{x^{N+1}}, $$

where $Q(x)^{-1}$ is the inverse polynomial modulo $x^{N+1}$.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .