[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #57964] polyfit() results for polynomial degre
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #57964] polyfit() results for polynomial degree greater or equal than number of data |
Date: |
Tue, 10 Mar 2020 11:39:40 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko |
Update of bug #57964 (project octave):
Item Group: Incorrect Result => Missed Error or Warning
Status: None => Confirmed
Release: 5.2.0 => dev
_______________________________________________________
Follow-up Comment #3:
Changing the item group to "Missed Error or Warning". Bumping the Release to
"dev". Marking as confirmed.
At the very least, it would be good to issue a warning. The return value for
the degrees of freedom output "df" is -1 which is nonsensical.
I tested a bit with Matlab and it does return consistent outputs for the
second and third outputs S and MU.
[P, S, MU] = polyfit (...)
However, the values are definitely not unique. If I call polyfit with a
single output I get
[p] = polyfit ([1 2],[3 4],2)
p = [0.3333 0 2.6667]
But when I call it with three outputs I get
[p, s, mu] = polyfit ([1 2],[3 4],2)
p = [0 0.7071 3.5]
Given this pseudo-randomness, I'm not sure we have to exactly match Matlab
behavior so much as issue a warning and be consistent.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?57964>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/