I'm not sure I understand the max.col spec or its rationale. In particular:
* What is the significance and effect of "assuming that the entries are
probabilities", as they do not seem to be limited to the interval [0,1]?
* In what contexts is it useful for max.col to consider numbers within a
certain tolerance equal?
* Why is a fixed relative tolerance of 1e-5 useful? That seems many orders
of magnitude greater than typical rounding errors, but arbitrary in terms of
data analysis, where different data sets or statistics may have widely
varying error distributions. And I'd have thought a tolerance of 0 natural
in many cases.
My guess is that there is some particular kind of analysis where these are
all natural background assumptions, but it is not clear what that analysis
is.
Also, max.col is part of 'base', so the authors must have thought that these
assumptions were generally applicable. Can someone clarify?
Thanks,
-s
On Thu, May 28, 2009 at 5:02 PM, Bert Gunter wrote:
> Try reading the man page, which says:
>
> Details
>
> When ties.method = "random", as per default, ties are broken at random. In
> this case, the determination of a tie assumes that the entries are
> probabilities: there is a relative tolerance of 1e-5, relative to the
> largest (in magnitude, omitting infinity) entry in the row.
>
>
> Bert Gunter
> Genentech Nonclinical Biostatistics
>
> -----Original Message-----
> From: r-help-bounces@r-project.org [mailto:r-help-bounces@r-project.org]
> On
> Behalf Of Daryl Morris
> Sent: Thursday, May 28, 2009 1:47 PM
> To: r-help@r-project.org
> Subject: [R] max.col weirdness
>
> Hi,
> I think there's some rounding issue with returning the max column.
> (running 2.9.0 on an Apple, but my buddy found it on his PC)
>
> > x <- matrix(c(1234.568,1234.569,1234.567),1)
> > max.col(x)
> [1] 2
> > x <- matrix(c(12345.568,12345.569,12345.567),1)
> > max.col(x)
> [1] 3
> > x <- matrix(c(112345.568,112345.569,112345.567),1)
> > max.col(x)
> [1] 3
> > max.col(-x)
> [1] 1
>
> Thanks, Daryl
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
[[alternative HTML version deleted]]