URL: <https://savannah.gnu.org/bugs/?67301>
Summary: Bug: Test for existence of uniform random variate in
histogram
Group: GNU Scientific Library
Submitter: fermelelundi
Submitted: Thu 10 Jul 2025 09:49:25 AM GMT
Category: None
Severity: 3 - Normal
Operating System:
Status: None
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Release:
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Thu 10 Jul 2025 09:49:25 AM GMT By: Fermé le Lundi <fermelelundi>
In histogram/pdf2d.c the function gsl_histogram2d_pdf_sample() create a sample
from a bivariate histogram. It contains a test for the existence of the random
variate r1 in this distribution:
status = find (p->nx * p->ny, p->sum, r1, &k);
if (status)
{
GSL_ERROR ("cannot find r1 in cumulative pdf", GSL_EDOM);
}
The code then proceeds with finding the sample value. However, shouldn't the
same test be performed for r2? That would mean the test would look something
like the following:
status = find (p->nx * p->ny, p->sum, r1, &k);
if (status)
GSL_ERROR ("Cannot find r1 in cumulative distribution function p",
GSL_EDOM);
status = find (p->nx * p->ny, p->sum, r2, &k);
if (status)
GSL_ERROR ("Cannot find r2 in cumulative distribution function p",
GSL_EDOM);
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?67301>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
