get_MAP_internal function

Internal function to find the maximum a posteriori (MAP) estimate of the MCMC chain