Let my.ncp be greater 0. Then, for any my.p in [0, 1] qt(my.p, Inf, my.ncp) results in NaN (including a warning message).
Based on the line
if (!R_FINITE(df)) ML_ERR_return_NAN;
in qnt.c it appears that this behavior is intended. But according to the manual df = Inf should be allowed. Because for increasing degrees of freedom the non-central t distribution approaches the normal distribution with mean = my.ncp and sd = 1, I would have expected to get qnorm(my.p, mean = my.ncp, sd = 1) for the limiting case df = Inf.
My question therefore is: Wouldn’t it make sense to generally return the result from qnorm in case df exceeds some large value, say 10^10?
Thank you, Benjamin,
your suggestion makes sense ('cum grano salis' in any case).
Instead of an arbitrary cutoff (which should depend on "my.p" and "my.ncp")
it seems much easier -- and to work correctly -- I'll have to check more thoroughly --
to just replace 'Inf' by something like 1e300.
Thank you for the good observation and suggestion!
Fix --- only for the case df = Inf --- now commited to R-devel and R-patched,
i.e., will be in R 3.2.2, due in mid August.
There are many numerical problems if you look in the hairy details of the
non-central t distribution and hence also quantile function.
For finite df, the distrib and inverse (i.e. the quantile) depend on three parameters, and cutoffs should depend on all three parameters.
I agree; Thank you for taking this up!