Just trying to understand why when I find the root of the following equation in excel I get a value however in R I get the "no sign change found error"
(-exp(-i*x))-x + 1
i = 1 in this case.
I'm plotting a graph where the value for i is 1:5. I've done this manually on excel and got a value of 0.003 when i = 1, here is the graph for all values of i: image 1
When try to find the root for when i = 1 in R though I get the error.
This is the code I am using to find the root:
func1 <- function(x) {
(-exp(-1*x))-x+1
}
root <- uniroot(func1, lower =0.5, upper = 1, extendInt = "yes")
print(root)
print(root$root)
}
Plotting the equation when i = 1 gives the following curve: image 2
Looking at the curve it doesn't seem like f(x) crosses 0 which explains the error, however, I get a value in excel.
Any help on this would be really appreciated
Thanks