model 1 and optimization p(d)