[Rd] Noncentral dt() with tiny 'x' values (PR#8874)

meredith at easynet.co.uk meredith at easynet.co.uk
Thu May 18 03:52:51 CEST 2006

Full_Name: Mike Meredith
Version: 2.3.0
Submission from: (NULL) (

Using dt() with a non-centrality parameter and near-zero values for 'x' results
in erratic output. Try this:

tst <- c(1e-12, 1e-13, 1e-14, 1e-15, 1e-16, 1e-17, 0)

I get:  0.2381019 0.2385462 0.2296557 0.1851817 0.6288373 3.8163916 (!!)

The 0.238 values are okay, the others nonsense, and they cause confusing spikes
on plots of dt() vs 'x' if 'x' happens to include tiny values. (Other values of
df and ncp also malfunction, but not all give results out by an order of

I'm using the work-around dt(round(x,10),...), but dt() should really take care
of this itself.

Regards,  Mike.

More information about the R-devel mailing list