# Maximum likelihood of a non-injective transformation

Problem: Let $g(z|a,b,c,d) = a + bz + cz^2 + dz^3$ be a polynomial function of degree 3. Clearly, $g$ is not monotone increasing for all values of $a,b,c,d$. Suppose I observe data $Y_1, \cdots, Y_n$ where $Y_i = g(Z_i|a,b,c,d)$ and $Z_i \sim N(0, 1)$. What is the best approach to finding the MLE's for $a,b,c,d$? For identifiability, assume $b > 0$.

Solution Attempt #1: Starting with CDF's, we have $$F_Y(y) = P(Y \le y) = P(g(Z) \le y) = \begin{cases} \Phi(r_1) && \text{if } g(z) = y \text{ has one solution, r_1, and d > 0} \\ 1 - \Phi(r_1) && \text{if } g(z) = y \text{ has one solution, r_1, and d < 0} \\ \Phi(r_3) - \Phi(r_2) + \Phi(r_1) && \text{if } g(z) = y \text{ has three solutions r_3 > r_2 > r_1 and d > 0} \\ 1 - (\Phi(r_3) - \Phi(r_2) + \Phi(r_1)) && \text{if } g(z) = y \text{ has three solutions r_3 > r_2 > r_1 and d < 0} \end{cases}$$ where $\Phi$ is the standard normal CDF. It's not difficult to construct this; one can just consider the preimage $\{z: g(z) \le y\}$, which depends on where the line $Y = y$ intersects the function $g$. For example, in the image below, $d > 0$ and we only have one solution. If I had moved the constant line a little further down, we would have three solutions.

Of course, these roots $r_1, r_2, r_3$ will be functions of $a,b,c,d$ related through the cubic formula, and I tried to take derivatives with respect to $a,b,c,d$ for standard gradient-optimization, but the number of roots will certainly change depending on the solution! So instead, to approximate the pdf, I constructed a sequence of finite differences $\Delta F_Y(y)/\Delta y$. From this, I can perform standard optimization procedures, although here I resort to numerical MLE, since I have to recompute the pdf every time rather than finding an analytical solution. In fact, I couldn't find an analytical solution and have to resort to numerical optimization. Is there a way to find solutions analytically?

Solution Attempt #2 I instead contemplated using series reversion as an approximation, but I again experience difficulties with multiple roots and such.

Ultimately, I need the computation of MLE's for $a,b,c,d$ to be quite fast.