Symbolic differentiation ("D","deriv", etc.) (PR#1928)

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
22 Aug 2002 17:45:19 +0200


lylek@utk.edu writes:

> > lnlk<-expression(15*log(p)+11*log(1-p))
> > p<-15/26
> > D(D(lnlk,"p"),"p")
>  - (15 * 1/p^2 + 11 * 1/(1 - p)^2)
> > - (15 * 1/p^2 + 11 * 1/(1 - p)^2)
> [1] -106.5212
> 
> R seems to be dropping the outer parentheses.

Yes. Duncan Murdoch has been working on that recently.  

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._