I need to evaluate a hazard function $h(t;\theta) = \dfrac{f(t;\theta)}{1-F(t;\theta)}$, where $f$ and $F$ are a pdf and a cdf, respectively, at many values of $t$ (and for several values of the parameter $\theta$). In some cases, when I evaluate $F(t;\theta)$, it returns the value $1$ for some values of $t$, making $h$ infinite.
For example, in R pweibull(100,1,1)
returns 1
.
Is there any trick to avoid this problem?
- I wasn't sure if I should ask this question on stackoverflow instead, but since the question is related to a function that is widely used in statistics, I thought crossvalidated was a better place as some people may know of a "classical" solution.