# Solving estimating equation using R [closed]

I am working with different types of data and comparing a variety of estimating equation approaches which share a multi-dimensional parameter $$\beta$$. Given a set of data $$\boldsymbol{X}$$, is there an easy way to solve for $$\beta$$ numerically using R code for an estimating equation of the form: $$U(\boldsymbol{X}, \beta) = 0?$$ I am aware of the function uniroot in one-dimension but how can it be extended to say two or three dimensions?

• What is $U$? Is it the score function? Commented Sep 27, 2022 at 3:49
• A general equation but not necessarily something that is a score function. For example, it could be represent a generalized estimating equation or it could represent an equation based on the ranks of the observed data. I am concerned with how the roots are computed in R. Commented Sep 27, 2022 at 3:56

$$L(\beta) \equiv U(\mathbf{X}, \beta)^2.$$
You can use the nlm function in R to undertake nonlinear minimisation of this objective function, including in cases with a vector parameter. This function also allows you to specify a relevant gradient vector and Hessian matrix if you have analytic results for these (of you can leave them out and R will estimate them numerically). I often use this method when dealing with cases like this in R and it usually works quite well. For best performance I recommend using appropriate parameter transforms (if needed) to ensure that you are doing unconstrained optimisation with the nlm function.