Calculation of the effective moment of a localized spin