forcing form of weight function, made compute_apc_from_pairs have methods for glm and function objects