Re: Degree of accuracy needed to prove two algorithms are the same?

From: Mark Von Tress (vontressms_at_cs.com)
Date: 08/04/04


Date: 4 Aug 2004 06:59:52 -0700

Eric,
  It depends on your purpose. If you are just trying to make sure that
you understand what your software's algorithms are doing, then you can
accept more error in the output. Here is an example from my more
industrious past. PROC MIXED from SAS was new. I wanted to make sure I
understood it, or at least the parts of it that I used. So, I took to
C++ and a matrix library and proceded to code the variance component
models using Hartley's W transform. I got it to agree with proc mixed
in the ML and REML estimates to about 4 or 5 decimal places. I was
also able to get their degrees of freedom using there descriptions in
the documentation. I did the same thing for proc logistic. I had
confirmed my understanding.

However, I would not go so far as to report the results from my
program to a regulatory agency like FDA because I only got 4 or 5
decimal accuracy, and SAS was already available to me. Plus, SAS has
the benifit of having been developed in a strict environment by
dedicated professional programmers and statisticians. There is no way
I can reproduce that level of quality as an individual.

Now to answer the question you asked. I not aware that such a standard
exists. If you are trying to develop a professional software for sale,
you are headed for hard times. That market is dominated. Now, if you
are just doing research and testing new ideas about the statistical
properties about your research, then the size of the numerical error
in your routines needs to be much less than the random error in the
data. Mathematica is up to that challenge.

If you get accuracy to 4 or 5 decimal places for the same input to a
complicated algorithm, then you will be fine for most things. My
feeling is that iff the random variation in the data is at least 100
times larger than than the numerical error, then the variation in the
output variables will be due to the randomness in the system being
studied rather than numerical error.

Just make sure that any matrices you invert are well conditioned, or
that your inversion algorithm can tolerate poorly conditioned
matrices. This can intruduce large amounts of numerical error that
will be larger than the variation in the data you are trying to study.
The distribution functions in Mathematica are probably good enough in
the useful range of their data to be right. Most programs will handle
the extremes of a distribution differently, so there is a watchout.
They are all different in the central normal distribution beyond +/-4.
This can effect quality control studies.

Mark

tookeey@yahoo.com (Jenet Sinclair) wrote in message news:<19caf5.0408021034.491497c0@posting.google.com>...
> Hello,
>
> I use Mathemetica as a verification tool for my software's
> algothims. Theoretically, if Mathematica and I implemented the same
> algorithm and I gave each the same input data, then the results should
> the same. My question is what level of accuracy verifies they are
> "the same"? An error margin of plus or minus ten to the negative
> sixth? Ten to the negative ninth? Is there any industry standard
> regarding this? Are there known limitations of Mathemetica or
> computer processors that can dictate to me what is actual error
> (possible bugs in my algorithm) and what is normal statistical error?
>
> Thanks for pondering my query!
> Eric



Relevant Pages

  • Re: 0^0 oh no!
    ... you'd use SetPrecision to tell the system to ... in Mathematica one would typically use SetPrecision if coding ... For languages that work in fixed precision (I think ... think typically one would, at the finish of an iterative algorithm, ...
    (sci.math.symbolic)
  • Re: Second TI-Nspire report
    ... It might be because Mathematica does not check that the ... without sqrt in the denominator of the matrix elements? ... extension of Q containing all the sqrt, ... should take around 10 minutes with the current Xcas algorithm. ...
    (comp.sys.hp48)
  • Re: Second TI-Nspire report
    ... It might be because Mathematica does not check that the ... without sqrt in the denominator of the matrix elements? ... extension of Q containing all the sqrt, ... should take around 10 minutes with the current Xcas algorithm. ...
    (comp.sys.hp48)
  • Re: Second TI-Nspire report
    ... without sqrt in the denominator of the matrix elements? ... extension of Q containing all the sqrt, ... should take around 10 minutes with the current Xcas algorithm. ... Or maybe mathematica has a better algorithm, ...
    (comp.sys.hp48)