[R] Looking for package to solve for exponent using newton's method
Duncan Murdoch
murdoch.duncan at gmail.com
Thu Oct 10 20:59:15 CEST 2013
On 10/10/2013 2:39 PM, Ken Takagi wrote:
> Hi,
> I'm looking for an R function/package that will let me solve problems of the
> type:
>
> 13 = 2^x + 3^x.
>
> The answer to this example is x = 2, but I'm looking for solutions when x
> isn't so easily determined. Looking around, it seems that there is no
> algebraic solution for x, unless I'm mistaken. Does anyone know a good
> package to solve these types of problems? Are there built in functions to do
> this?
You can get approximate solutions using uniroot:
> uniroot(function(x) 2^x + 3^x - 13, c(0, 10))
$root
[1] 1.99998
$f.root
[1] -0.0002581592
$iter
[1] 10
$estim.prec
[1] 6.103516e-05
More information about the R-help
mailing list