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

From: Ben Bolker <>
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.)

> 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, 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.

 ... 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 mailing list
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 Please read the posting guide before posting to the list.

list of date sections of archive