This question is a followup on this one on stackoverflow where i implement in python this issue. I am applying the Faà di Bruno formula to obtain the $\mathbf{i}$th derivatives of the function $f = ln \circ g$ in terms of the derivatives of $g$, a function with $n$ variables. This yield the following formula, denoting by $f^{(\mathbf i)}$ the $\mathbf i$th derivative of a function f
$$f^{(\mathbf i)}(t) = \sum\limits_{\pi \in \Pi(\mathbf{i})} (\lvert \pi \rvert -1) (-1)^{\lvert \pi \rvert -1} g(t)^{- \lvert \pi \rvert} \prod\limits_{B \in \pi} g^{(\mathbf{i}(B))}$$
where the notation follows this section of the wikipedia page, plus a small variation that recover the multiindex $\mathbf i(B)$ from the set of dimension indexes $B$.
The problem is that, since the exponential function has all it's derivatives equal, as soon as we want to derivate twice on the same variable, i obtain several $\pi$ inside $\Pi(\mathbf i)$ that are equivalent.
For exemple, set $\mathbf i = (2,1)$ in a two-dimensional problem. Then, the partitions inside $\Pi(\mathbf i)$ are:
- $(0,0,1)$
- $(1), (0,0)$
- $(0), (0,1)$
- $(0, 1), (0)$
- $(0) (0) (1)$
There is here a partition that appears twice (without taking into account the order of blocks inside a partition), and which will have the same value into the sum.
This happends a lot (run my code from stackoverflow to find out). Is there a way i could 'factorise' the formula ?
Edit: For $n = 1$, in a one-dimensional problem, the formula indeed factorises to the Bell polynomials, and the number of occurences of similar partitions are the Bell numbers. Is there somewhere a multivariate equivalent ?
Edit: This problem is equivalent to finding all multiset-partitions of a multiset. The solution in term of multivariate partial Bell polynomials exists (see article in a comment), but the polynomials in question are still hard to implement.