Re: [R] Loss of numerical precision from conversion to list ?

From: Peter Dalgaard <>
Date: Fri 21 Jul 2006 - 18:07:31 EST

Duncan Murdoch <> writes:

> R tries to use the maximum precision (64 bit mantissa) in the floating
> Or perhaps your problem has nothing to do with this; I didn't really
> look at it in detail.

It hasn't. I was off speculating about sum vs rowSums too, but:

> > num.v<- rowSums(((lambda-lambda0)*mu*w.k.sq[,-(K+1)])/(1+lambda*mu))

Inside this, we have mu*w.k.sq[,-(K+1)] . mu is a vector of length 27, and w.k.sq has 10 rows and 28 *columns*. Column-major storage and vector recycling kicks in... If mu has identical elements (never mind the magnitude), of course, the recycling doesn't matter.

   O__  ---- Peter Dalgaard             ุster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (                  FAX: (+45) 35327907

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Fri Jul 21 18:09:55 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 Fri 21 Jul 2006 - 20:16:42 EST.

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