Re: [Rd] extending the derivs table/fools rushing in

From: Ben Bolker <bolker_at_zoology.ufl.edu>
Date: Thu, 14 Aug 2008 14:59:11 -0400

Prof Brian Ripley wrote:
> The derivative of plogis is surely dlogis. (And yes, there is a good
> reason why we have such a function: take a look at its C code.)

  Doh.
>
> That means we would need an entry for dlogis too, I guess. I am not
> convinced that there is a real need for these (and where does this
> stop?) What would be much more useful is to make this user-extensible
> (as Bill Venables pointed out a decade ago). [pd]norm were added in
> 2002 to support MASS, the ability to do all of MASS in R being a goal at
> the time.

   I agree it would be great to make this user-extensible, but it's probably a bit beyond me ... I found a web-reference of Venables saying

> There is a detailed example towards the end of Ch. 9 of V&R on how
> to extend D() and make.call(), which are the work horses for
> deriv(), to handle new functions. The new functions handled there
> are dnorm() and pnorm(), but I() would be even easier, of course.

http://www.math.yorku.ca/Who/Faculty/Monette/pub/s-old/0690.html

 ... but this is from 1997 therefore presumably MASS3? or MASS2? -- I can't find my copy of MASS3 at the moment, and don't own MASS2 ...

   The reason behind this is that I was trying to write a simple analytic derivative calculator for formulae of the form (e.g.)

y ~ dbinom(prob=plogis(a+b*x),size=N)

Obviously in this case I could just tell people to write the formula out as

y ~ dbinom(prob=1/(1+exp(-(a+b*x))),size=N)

 ...

  Ben Bolker



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Thu 14 Aug 2008 - 19:01:17 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 14 Aug 2008 - 20:38:11 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive