My understanding of lchoose function in R is simply lchoose(a,b) = log(choose(a,b)). However, I found that:
temp <- 7.9999993
k <- 8
choose(temp,k)
[1] 0
lchoose(temp,k)
[1] 0
log(choose(temp,k))
[1] -Inf
So lchoose is not log of the choose function output. Why is this happening?
In the discrete case (i.e discrete
n
),choose(n,k)
computes the number of distinct k-element subsets from a set ofn
elements, so ifk > n
, then you are counting subsets of a set which have more elements that the corresponding set. Since there are no such subsets, then the answer is zero.In general, for an
n
which is a real number, the function can still be computed, but however, the function still has to have the same meaning over discrete values, so fork>n
the function has a value of zero. If you look at the definition of the binomial function with realn
(see here) you'll see that the answer will be zero, but I tried to explain it, hopefully, in an intuitive manner.