1
$\begingroup$

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?

$\endgroup$
2
  • 2
    $\begingroup$ What is $U$? Is it the score function? $\endgroup$ Commented Sep 27, 2022 at 3:49
  • $\begingroup$ 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. $\endgroup$
    – J McVittie
    Commented Sep 27, 2022 at 3:56

1 Answer 1

1
$\begingroup$

Without knowing more about your function it is difficult to offer an optimal solution. However, one approach is to use a general nonlinear optimisation routine to minimise the quantity:

$$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.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.