[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #58324] regress.m: Calling on two identical da
From: |
Ben Brown |
Subject: |
[Octave-bug-tracker] [bug #58324] regress.m: Calling on two identical data sets causes divide by zero |
Date: |
Thu, 7 May 2020 12:07:41 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 |
URL:
<https://savannah.gnu.org/bugs/?58324>
Summary: regress.m: Calling on two identical data sets causes
divide by zero
Project: GNU Octave
Submitted by: benbrown
Submitted on: Thu 07 May 2020 04:07:39 PM UTC
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Missed Error or Warning
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Release: 5.2.0
Discussion Lock: Any
Operating System: Any
_______________________________________________________
Details:
X = [ones(size(data)) data];
y = data;
[~,~,~,~,stats] = regress(y,X);
warning: division by zero
warning: called from
regress at line 171 column 7
in regress.m
167: R2 = 1 - SSE / sum ((y - mean (y)) .^ 2);
171: F = dof / (p - 1) / (1 / R2 - 1);
But R2 = 1 as there are no residual errors
I changed to:
if (R2 < 1)
F = dof / (p - 1) / (1 / R2 - 1);
else
F = Inf;
end
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?58324>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #58324] regress.m: Calling on two identical data sets causes divide by zero,
Ben Brown <=