I'm having a numeric issue using qnorm(psn())
. The problem is numeric.
Firstly, the Skew-Normal CDF round the result, since psn(9)
is not 1
:
library(sn)
psn(9)
#[1] 1
then
qnorm(psn(9))
#[1] Inf
And see that:
qnorm(.9999999999999999)
#[1] 8.209536
qnorm(.99999999999999999)
#[1] Inf
note that 8.209536
is not that big, so this rounding is very imprecise.
Then, my final problem is the calculation of qnorm(psn())
, that is part of my Copula density. Any hint on how can I avoid these numerical problems?
(This is not a resolution to your dilemma, more of an explanation of why I think you're seeing this and perhaps not likely to find an easy solution.)
I think this is getting into the realm where normal floating-point precision isn't going to work for you. For instance, doing the inverse of your function:
which is very close to
which, according to
?.Machine
, isIt might be possible to translate what you need into higher-precision using auxiliary packages like
gmp
orRmpfr
. (I don't know if they supportqnorm
-like operations.)