octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #55587] splinefit.m BIST may fail, slightly ou


From: Rik
Subject: [Octave-bug-tracker] [bug #55587] splinefit.m BIST may fail, slightly out of tolerance result
Date: Wed, 30 Jan 2019 14:45:38 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Follow-up Comment #8, bug #55587 (project octave):

I re-read the original discussion.  I guess we can just relax the tolerance,
but I still find it weird that the example you extracted fails repeatedly for
you, and yet for Dmitri and I it passes.  That points to something I don't
understand which makes me uneasy.

I don't think the tolerance should depend on norm (y).  The test in question
calculates expected y values two ways: 1) interp1 and 2) ppval (splinefit ()).
 The comparison is done indivdually and independently for each value of y,
rather than mixing components of the y vector as would be the case for a
solution to Ax = b.

Looking at the code in ppval.m, Octave uses Horner's algorithm to evaluate the
cubic polynomial


  for i = 2 : k
    yi .*= dx;
    yi += shiftdim (reshape (Pidx(i,:), dimvec), ndv - 1);
  endfor


In this case, k = 4, so this loop is executed 3 times.  Assuming worst case,
every single unit operation results in a discretization error of 1 eps (all of
the interpolated values are between -1 and +1 so this is a valid assumption). 
That would mean 3 eps for the multiplications and 3 eps for the additions.

After that, you would want to look at the error in the coefficients dx and
Pidx. I don't really want to trace down any further in to the algorithms, so
we should just pick a number.  Are the dx coefficients off by 2 eps?  Okay
that would be 6 eps in total.  Assume the same for the Pidx, and that is
another 6 eps.

The assert statement calculates (observed - expected) which could result in
another 1 eps error.  I'm at a total of 19 eps so far.

@Mike: Can you change to 20 eps and then see if you ever get any failures?


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55587>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]