Note: This is a private function.
Checking gradient derivation of log-likelihood
Syntax
check_grad(D, theta, data)