[R] Loss of numerical precision from conversion to list ?
Fabian Scheipl
f.abian at gmx.net
Fri Jul 21 11:51:07 CEST 2006
Thank you both very much for your help.
Peter Dalgaard is right- i didn't consider the fact that elementwise multiplication is column-wise rather than row-wise.
Sorry for taking up time&space with such a trivial mistake.
-------- Original-Nachricht --------
Datum: 21 Jul 2006 10:07:31 +0200
Von: Peter Dalgaard <p.dalgaard at biostat.ku.dk>
An: Duncan Murdoch <murdoch at stats.uwo.ca>
Betreff: Re: [R] Loss of numerical precision from conversion to list ?
> 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
--
Echte DSL-Flatrate dauerhaft für 0,- Euro*!
More information about the R-help
mailing list