3
$\begingroup$

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:

enter image description here

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?

$\endgroup$
3
  • 1
    $\begingroup$ Why don't you directly aplly an optimization algorithm to the log-likelihood function, e.g. Nelder-Mead (does not require derivatives)? $\endgroup$ Commented Jan 7, 2022 at 13:46
  • $\begingroup$ By imposing such artificial constraints on the solution method, you have framed this as a self-study exercise in applied mathematics rather than as a problem in statistics or machine learning. $\endgroup$ Commented Jan 7, 2022 at 15:01
  • $\begingroup$ What do you mean by artificial constraints?? Those are exactly the conditions that negative binomial model is estimated from. $\endgroup$ Commented Jan 7, 2022 at 15:09

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.