[Rd] Bug or not? (PR#8977)
Joerg van den Hoff
j.van_den_hoff at fz-rossendorf.de
Wed Jun 14 18:10:48 CEST 2006
> Hi,
>
> I am writing this email, because I am not sure if the issue I have
> discovered is a bug or not.
>
> For a few days I have been fiddling around with a small program that
> calculates the reflectance of multilayer dielectric mirrors (eg. bragg
> mirrors). It does not really matter what I did, what matters is that I
> could not do that using R.
> I had some sample data which I used to test if my R program works
> correctly (if it fits the data it works). This sample data was for two
> different incident angles with respect to the normal of the hypothetical
> bragg mirror (0=B0 and 70=B0). The plots for 0=B0 matched perfectly but t=
> hose
> for 70=B0 were quite a bit off. After trying out all sorts of things for
> several days, I tried the same algorithm in octave (matlab clone, but
> open source). There, I got a perfect match for both 0=B0 and 70=B0. I alm=
> ost
> could not believe it, R must have calculated wrong.
>
> The R version I use at home at the moment is 2.2.1 on gentoo linux. I
> also tried version 2.1.0 at my university (debian stable), both had the
> same result.
>
> I uploaded everything to reproduce this to
>
> http://n.ethz.ch/student/homartin/r-vs-octave/
>
> There, you can also find the .pdf file of the comparison of the
> reference, the R output and the one from octave.
>
> The calculations are quite complex, nevertheless, I would be very happy
> to read your reply concerning this problem.
>
> Thanks in advance, best Regards,
> Martin
>
>
I get only the r-devel digest, so I could'nt respond the direct way
(this message will not show up in the correct thread, probably), but:
there is nothing wrong with the R results AFAICS: I translated your
octave script one-to-one to R (see attachment). this produces (within
floating point prec. (double)) the same results. I propose you go
through this and your own R-script (which honestly was unreadable to me
:-)) with browser() or debug() and compare results for Ms1, Ms2, Msr on
the way to localise the differences in computation.
if you uncomment the last few lines, source("Rs.R") will give you
vectors which you can directly compare to the octave results (note that
the leading 499 zeros are still there, since I mimicked your octave script)
so: really no bug, right?
joerg
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Rs.R
Url: https://stat.ethz.ch/pipermail/r-devel/attachments/20060614/6cc27ce0/attachment.pl
More information about the R-devel
mailing list