Re: [R] package:Matrix handling of data with identical indices

From: roger koenker <>
Date: Mon 10 Jul 2006 - 03:31:16 EST


On 7/8/06, Thaden, John J <> wrote:

> As there is nothing inherent in either compressed, sparse,
> format that would prevent recognition and handling of
> duplicated index pairs, I'm curious why the dgCMatrix
> class doesn't also add x values in those instances?

why not multiply them? or take the larger one, or ...? I would interpret this as a case of user negligence -- there is no "natural" default behavior for such cases.

On Jul 9, 2006, at 11:06 AM, Douglas Bates wrote:

> Your matrix Mc should be flagged as invalid. Martin and I should
> discuss whether we want to add such a test to the validity method. It
> is not difficult to add the test but there will be a penalty in that
> it will slow down all operations on such matrices and I'm not sure if
> we want to pay that price to catch a rather infrequently occuring
> problem.

Elaborating the validity procedure to flag such instances seems to be well worth the speed penalty in my view. Of course, anticipating every such misstep imposes a heavy burden on developers and constitutes the real "cost" of more elaborate validity checking.

[My 2cents based on experience with SparseM.]

url:                Roger Koenker
email                       Department of Economics
vox:    217-333-4558                            University of Illinois
fax:    217-244-6678                            Champaign, IL 61820

______________________________________________ mailing list PLEASE do read the posting guide! Received on Mon Jul 10 03:36:32 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 11 Jul 2006 - 02:15:34 EST.

Mailing list information is available at Please read the posting guide before posting to the list.