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

Peter Dalgaard p.dalgaard at biostat.ku.dk
Fri Jul 21 10:07:31 CEST 2006


Duncan Murdoch <murdoch at stats.uwo.ca> 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
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907



More information about the R-help mailing list