Hi ,
I would like to know if a R function have the same behaviour than the matlab
solve function.
I tried something with uniroot but I have some problems:
The equation I need to solve is :
exp(c0-r0)*(bb0+x)*(bb1-x)=(bb0+x+1)(bb1-x-1)
So I tried this:
STEP 1: my function test
test <- function(x,bb0=-3,bb1=5,c0=2,r0=0) {
+ ((exp(c0-r0)*(bb0+x)*(bb1-x))/((bb0+x+1)(bb1-x-1))-1)}
STEP 2:
> uniroot(test,c(-100,100))$root*
Erreur dans f(lower, ...) :
tentative d'appliquer un objet qui n'est pas une fonction*
R tells me that test is not a function ...
STEP 3:
> is.function(test)
[1] TRUE
Thanks,
Yann
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.