code to compute various statistical distributions