added estfun.R function to compute case-wise scores (contributed by Ed Merkle)