gftool.polepade.residues_ols

gftool.polepade.residues_ols(z, fct_z, poles, weight=None, moments=())[source]

Calculate the residues using ordinary least square.

Parameters:
z, fct_z(N_z) complex np.ndarray

Variable where function is evaluated and function values.

poles(M) complex np.ndarray

Position of the poles of the function.

weight(N_z) float np.ndarray, optional

Weighting of the data points, for a known error σ this should be weight = 1./σ.

moments(N) float array_like

Moments of the high-frequency expansion, where f(z) = moments / z**np.arange(1, N+1) for large z.

Returns:
residues(M) complex np.ndarray

The residues corresponding to the poles.

residual(1)

Norm of the residual.