From dieter.menne@menne-biomed.de  Sun Oct  7 11:24:19 2001
From: dieter.menne@menne-biomed.de (dieter.menne@menne-biomed.de)
Date: Sun, 7 Oct 2001 12:24:19 +0200 (MET DST)
Subject: [Rd] Bug in Deriv? (PR#1119)
Message-ID: <200110071024.MAA09258@pubhealth.ku.dk>


deriv seems to have problems with a minus-sign before a bracket.
Below are four examples of the same function, the top one
is wrong, all others are correct (hopefully).


Rest of expression not shown, it is the same for all versions.

         _
platform i386-pc-mingw32
arch     x86
os       Win32
system   x86, Win32
status
major    1
minor    3.0
year     2001
month    06
day      22
language R

-----------------------------------------------------------------
> deriv(~offv+Asym/(1+exp(-(x-xmid)/scal)),"x")
expression({
    .expr4 <- exp(-x - xmid/scal)  #### Wrong !!!!

> deriv(~offv+Asym/(1+exp(-x/scal+xmid/scal)),"x")
expression({
    .expr5 <- exp(-x/scal + xmid/scal)  ## Correct

> deriv(~offv+Asym/(1+exp((xmid-x)/scal)),"x")
expression({
    .expr3 <- exp((xmid - x)/scal)  ## Coorrect

> deriv(~offv+Asym/(1+exp(-1.0*(x-xmid)/scal)),"x")
expression({
    .expr5 <- exp(-1 * (x - xmid)/scal) ## Correct


---------------------------------------
Dr. Dieter Menne
Biomed Software
72074 Tbingen
Tel (49) (7071) 52176
FAX (49) (7071) 55 10 46
dieter.menne@menne-biomed.de
www.menne-biomed.de


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] Bug in Deriv? (PR#1119)
dieter.menne@menne-biomed.de