A semiempirical model for the phase transition in polystyrene latexes