bugGNU Octave - Bugs: bug #31871, interp1 gives the wrong result for...

 
 

bug #31871: interp1 gives the wrong result for cubic interpolation

Submitted by:  Ben Abbott <bpabbott>
Submitted on:  Tue 14 Dec 2010 02:53:49 AM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Mac OS

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 16 Apr 2011 03:01:08 PM UTC, comment #5:

Yes, Thorsten fixed it with another changeset.

http://hg.savannah.gnu.org/hgweb/octave/rev/b3f9f98e7640

Ben Abbott <bpabbott>
Project Member
Sat 16 Apr 2011 11:18:43 AM UTC, comment #4:

Ben,

this seems to work now.

octave:1> x = [1:4, 10];
octave:2> f = @(x) polyval ([0 1 1], x);
octave:3> interp1 (x, f(x), x, "cubic")
ans =

2 3 4 5 11

octave:4> f(x)
ans =

2 3 4 5 11

octave:5>

Can we close this bug?

Kai

Kai Habel <kahacjde>
Project Member
Thu 16 Dec 2010 03:46:28 PM UTC, comment #3:

I"ve attached a patch. It includes a new test.

(file #22213)

Ben Abbott <bpabbott>
Project Member
Thu 16 Dec 2010 03:12:50 PM UTC, comment #2:

We could do that. Would it make sense to fix the current method and use it for "v5cubic"?

I haven't gotten the details figured out, but it looks to me like only the 3rd order terms are wrong. Meaning for ...

y = ax.^3 + bx.^2 + c*x + d

Is it the solution for "a" that has the bug.

Ben Abbott <bpabbott>
Project Member
Thu 16 Dec 2010 01:28:04 PM UTC, comment #1:

I can confirm with 3.3.53. Why don't we set cubic equivalent to pchip (as in ml)?

Marco

Marco Caliari <caliari>
Project Member
Tue 14 Dec 2010 02:53:49 AM UTC, original submission:

Simple example ...

I see the same result for 3.0.5 and the developer's sources.

Ben Abbott <bpabbott>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by kahacjde (Posted a comment)
  • -unavailable- added by caliari (Posted a comment)
  • -unavailable- added by bpabbott (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 16 Apr 2011 03:01:08 PM UTCbpabbottStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Thu 16 Dec 2010 03:46:28 PM UTCbpabbottAttached File-=>Added changeset.patch, #22213
      StatusNone=>Ready For Test

    Back to the top


    Powered by Savane 3.1-cleanup1