It sounds to me like you want to estimate the values of circuit elements (R, L, C, etc) that will fit a fit a particular measured, or target, transfer function or impedance (magnitude and phase). The predicted magnitude and phase are nonlinear functions of R, C, etc., so this is a nonlinear regression problem. The best way to fit magnitude and phase simultaneously is to minimize the sum squared distance on the complex plane between the target transfer function (or impedance) and the theoretical transfer function resulting from the R and C you have chosen.
Example: The target, or measured, magntide and phase are functions of frequency:
and
. You have a circuit design. You want to find the values of R and C that produce a transfer funciton that matches the target magnitude and phase. The theoretical magnitude and phase response for your circuit are
and
. Compute the complex measured response and the complex theoretical response:
and
. Then the error function, which you minimize with a nonlinear regression, is the sum squared difference between
and
over the frequency range of interest: where * indicates complex conjugate.