# [R] Initial value choosing in nleqslv package

Ebert,Timothy Aaron tebert @end|ng |rom u||@edu
Tue Nov 15 15:38:56 CET 2022

```I would suggest treating initial values as hyperparameters. Try a range of values to understand how your choice influences your outcome. Plot the result. Eventually (I hope) you will get a feel for the right answer for your specific type of data and you will be able to reduce the time needed for this activity.

If you want to be safe I would use the microbenchmark package to determine program run time. If runtimes are short then
I might try a range of 0 to 10 in steps of 0.01 and see what happens. If there is an interesting region I might then focus on that in finer steps.

Tim

-----Original Message-----
From: R-help <r-help-bounces using r-project.org> On Behalf Of ASHLIN VARKEY
Sent: Tuesday, November 15, 2022 2:49 AM
To: r-help using r-project.org
Subject: [R] Initial value choosing in nleqslv package

[External Email]

In my work, I use l-moments for estimation and obtain a system of nonlinear equations. I am using the 'nleqslv' package in the R- program to solve these equations but am struggling to choose initial values. Is there any criteria to choose initial values in this package or is there any other method to solve these equations?  My system of equations are given below.

simeqn=function(x){

y=numeric(4)

y=x*(((gamma(1+x)*gamma(x-x))/gamma(x))+((gamma(1-
x)*gamma(x+x))/gamma(x)))- 38353

y=x*gamma(1+x)*((gamma(x-x)/gamma(x))-(gamma(2*x-x)/gamma(2*x))-(gamma(x+x)/gamma(x))+(gamma(2*x+x)/gamma(2*x)))-
3759.473

y=x*gamma(1+x)*((gamma(x-x)/gamma(x))-(3*gamma(2*x-x)/gamma(2*x))+(2*gamma(3*x-x)/gamma(3*x))+(gamma(x+x)/gamma(x))-(3*gamma(2*x+x)/gamma(2*x))+(2*gamma(3*x+x)/gamma(3*x)))-
966.3958

y=
x*gamma(1+x)*((gamma(x-x)/gamma(x))-(6*gamma(2*x-x)/gamma(2*x))+(10*gamma(3*x-x)/gamma(3*x))-(5*gamma(4*x-x)/gamma(4*x))-(gamma(x+x)/gamma(x))+(6*gamma(2*x+x)/gamma(2*x))-(10*gamma(3*x+x)/gamma(3*x))+(5*gamma(4*x+x)/gamma(4*x)))-
500.952

y

}

[[alternative HTML version deleted]]

______________________________________________
R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see