[R] solve the equation in R
Petr Savicky
savicky at cs.cas.cz
Thu May 17 23:50:17 CEST 2012
On Thu, May 17, 2012 at 01:53:39PM -0500, Pei-Ling Lin wrote:
> Hi all,
>
> I need to solve this following equation which the unknown value (here is "a") is on the exponent place, could anybody please help me to figure it out? I tried to use lm.sol() or solve() function but it doesn't work......
>
> Thanks for help,
> Peiling
>
>
> (x, y) = (2.21, 1.01)
>
> y = 1 + x - ( 1 + (x)^a)^(1/a)
Hi.
First, plot the function
f <- function(a) { 1 + x - ( 1 + (x)^a)^(1/a) - y }
x <- 2.21
y <- 1.01
a <- seq(0.1, 20, length=1000)
plot(a, f(a), ylim=c(-0.2, 0.2), type="l")
abline(h=0)
This suggests, that there is no root. This may also be obtained
analytically.
Hope this helps.
Petr Savicky.
More information about the R-help
mailing list