randef and calcLogLik support