# bug #66034: [statistics] finv results when second value of degrees of freedom tends to infinity

 Submitter: José Luis García Pallero Submitted: Sat 27 Jul 2024 09:23:55 PM UTC Category: Octave Package Severity: 3 - Normal Priority: 5 - Normal Item Group: Incorrect Result Status: Confirmed Assigned to: None Originator Name: jgpallero Open/Closed:  * Open Release:  * other Operating System:  * Any Fixed Release: None Planned Release: None
* Mandatory Fields

Add a New Comment Rich Markup

## Discussion

Sun 28 Jul 2024 12:57:17 AM UTC, comment #2:

It is from "statistics"
And, yes, I can reproduce all those results with
statistics-1.6.7

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Sun 28 Jul 2024 12:51:10 AM UTC, comment #1:

Is this a problem in core Octave or a package?  I tried

which finv

and I get no result.

Rik <rik5>
Sat 27 Jul 2024 09:23:55 PM UTC, original submission:

Function

X = finv (P, DF1, DF2)

returns erratic values when DF2 adopts very big values:

>> finv(0.025,10,100000000000)
ans = 0.3908
>> finv(0.025,10,1000000000000)
ans = 0.3926
>> finv(0.025,10,10000000000000)
ans = 0.3697
>> finv(0.025,10,100000000000000)
ans = 0.1110
>> finv(0.025,10,1000000000000000)
ans = 1.4655
>> finv(0.025,10,10000000000000000)
ans = 0.2220
>> finv(0.025,10,100000000000000000)
ans = 1.4901e+07
>> finv(0.025,10,1000000000000000000)
ans = 1.4901e+08
>> finv(0.025,10,10000000000000000000)
ans = 1.4901e+09
>> finv(0.025,10,inf)
ans = NaN

If DF2 is assigned explicitly to infinity, the result is NaN

But in Matlab this problem is solved:

>> finv(0.025,10,100000000000)
ans =
0.3223
>> finv(0.025,10,1000000000000)
ans =
0.3223
>> finv(0.025,10,10000000000000)
ans =
0.3223
>> finv(0.025,10,100000000000000)
ans =
0.3223
>> finv(0.025,10,1000000000000000)
ans =
0.3223
>> finv(0.025,10,10000000000000000)
ans =
0.3223
>> finv(0.025,10,100000000000000000)
ans =
0.3223
>> finv(0.025,10,1000000000000000000)
ans =
0.3223
>> finv(0.025,10,10000000000000000000)
ans =
0.3223
>> finv(0.025,10,inf)
ans =
0.3247

The F-Snedecor with infinity degrees of freedom in the denominator tends to chi-square with DF1 divided by DF1:

>> chi2inv(0.025,10)/10
ans = 0.3247

I don't know the algorithm used in Octave, but at least it would be nice if infinity is used as DF2, it would be detected and internally use chi2inv (P,DF1)/DF1

José Luis García Pallero <jgpallero>

## Attached Files

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

Attach Files:

Comment:

No files currently attached

## Dependencies

Depends on the following items: None found

Items that depend on this one: None found

Carbon-Copy List
• -email is unavailable- added by dasergatskov (Posted a comment)
• -email is unavailable- added by jgpallero (Submitted the item)
•

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only group members can vote.