Closed avehtari closed 5 months ago
I think this occurs because ess_tail(c(1e-4,rep(1,999))
returns NA
(due to almost constant draws) in this case so the automatic calculation of relative efficiency ends up as NA
, and so does the tail length. Should pareto_khat return NA in this case?
I've started to think that maybe we should drop the relative efficiency adjustment of tail size. It is causing problems in edge cases. Anyway, for constant or almost constant such that tail would be constant, we can return NA, and give a warning
Inconsistent return type
> str(pareto_smooth(rnorm(1000), tail='right', return_k=FALSE))
num [1:1000] -0.136 -2.086 -1.33 -0.801 -0.612 ...
but
> str(pareto_smooth(rep(1,1000), tail='right', return_k=FALSE))
List of 2
$ x : num [1:1000] 1 1 1 1 1 1 1 1 1 1 ...
$ diagnostics: num NA
Warning message:
Input contains infinite or NA values, Pareto smoothing not performed.
This should be fixed now by #314 Not yet fixed.
also the following is a bit miseleading warning as 1) all values are finite, 2) smoothing was not requested