tested marginilzation, log partition, log likelihood, wrote optimization code