I want to estimate negative binomial regression for from scratch i.e. I want to write a script that will maximize maximum likelihood obtaining optimal parameters. To do so we can calculate derivatives and force them to be equal to 0.
Question
To estimate negative binomial regression we are looking for zeroes of those two expressions:
My question is - how can I now find such parameters $\alpha$ and $\beta$ that will find zero of a function os those two expressions? ($\beta$ is inside $\mu$)
My first idea was to denote first expression as $A$ and second expression as $B$.
Then we are looking for such $\alpha$ and $\beta$ that $A = 0$ and $B = 0$. The equivalent problem to consider is $A^2 + B^2 = 0$ and now we can use newton raphson method to find zero of this function. However, I find this solution little tedious since I have to calculate $\frac{\partial^2(A^2 + B^2)}{\partial \alpha^2}$, $\frac{\partial^2(A^2 + B^2)}{\partial \beta^2}$ and $\frac{\partial^2(A^2 + B^2)}{\partial \alpha \beta}$ to obtain Hessian. Is there any easier way to solve it?
