vectfit ¤
Single Vector Fitting iteration: pole identification + residue identification.
Combines pole_id and residue_id into one callable that mirrors the interface of vectfit4.m. The outer driver (driver.py) calls this in a loop.
Functions:
| Name | Description |
|---|---|
vectfit_iteration | One pass of Vector Fitting: pole ID then residue ID. |
vectfit_iteration ¤
vectfit_iteration(
f: ndarray,
s: ndarray,
poles: ndarray,
weight: ndarray,
opts: FitOptions,
Nc: int,
skip_pole: bool = False,
skip_res: bool = False,
reciprocal: bool = True,
) -> tuple[ndarray, VFModel | None, float]
One pass of Vector Fitting: pole ID then residue ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f | ndarray | (nnn, Ns) complex upper-triangle data. | required |
s | ndarray | (Ns,) complex frequency points. | required |
poles | ndarray | (N,) complex — current poles (updated in-place semantics). | required |
weight | ndarray | (nnn, Ns) or (1, Ns) — fitting weights. | required |
opts | FitOptions | FitOptions. | required |
Nc | int | number of ports (needed to reconstruct full residue matrices). | required |
skip_pole | bool | skip pole identification; use current poles directly. | False |
skip_res | bool | skip residue identification; return None model. | False |
reciprocal | bool | Reconstruct a mirrored triangle when true, or all ordered responses when false. | True |
Returns:
| Name | Type | Description |
|---|---|---|
new_poles | ndarray | (N,) complex NumPy. |
model | VFModel | None | VFModel or None (if skip_res). |
rmserr | float | float RMS fitting error (0.0 if skip_res). |