average place cell coordinates and cost function