The algorithm, used to optimize the likelihood function in a generalized linear model (GLM) such as poisson regression, is iterated weighted least square (IWLS), where the Newton-Raphson algorithm is used.
The single Newton-Raphson update is: $$ \begin{aligned} \beta^{new} &= \beta^{old} - \left(\frac{\partial^{2} L}{\partial \beta \partial \beta^{T}}\right)^{-1} \frac{\partial L}{\partial \beta} \\ &= \beta^{old} + (X^{T}WX)^{-1}X^{T}(V), \end{aligned} $$ where $\frac{\partial^{2} L}{\partial \beta \partial \beta^{T}}$ = $-X^{T}WX$, and W is a diagonal matrix whose elements are, for example, usually functions of inverse link function in GLM, and the derivatives are evaluated at $\beta^{old}$.
My question is that in my case, I cannot ensure that all the elements in W are positive, sometimes even negative values occurred, which causes positive definite problem. What should I do now?