From ripley at stats.ox.ac.uk  Wed May  9 13:00:14 2007
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Wed, 9 May 2007 12:00:14 +0100 (BST)
Subject: [Rd] One for the wish list - var.default etc
In-Reply-To: <s641aa32.094@tedmail2.lgc.co.uk>
References: <s641aa32.094@tedmail2.lgc.co.uk>
Message-ID: <Pine.LNX.4.64.0705091153330.7060@gannet.stats.ox.ac.uk>

On Wed, 9 May 2007, S Ellison wrote:

> I was working on a permutation-like variant of the bootstrap for smaller 
> samples, and wanted to be able to get summary stats of my estimator 
> conveniently. mean() is OK as its a generic, so a mean.oddboot function 
> gets used automatically. But var, sd and others are not originally 
> written as generic; they have to be explicitly masked by a package or 
> new declaration.
>
> It would have been nice if stats::var was a generic to make it more 
> easily extensible... one for the wish list?

There is a reason: does your version have exactly the semantics of the 
function in stats (which does more than compute a variance)?  If we make
functions generic, we rely on package writers implementing the documented 
semantics (and that is not easy to check).  That was deemed to be too
easy to get wrong for var().

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] One for the wish list - var.default etc
Prof Brian Ripley