more robust prior calculation