<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def phi(self):
 """get the weighted total objective function Returns ------- phi : float sum of squared residuals """

        sum = 0.0
        for grp, contrib in self.phi_components.items():
            sum += contrib
        return sum