pmrf.fitting.fitters.ScipyMinimizeFitter
- class pmrf.fitting.fitters.ScipyMinimizeFitter(model, measured, frequency=None, features=None, cost=None, *args, **kwargs)[source]
Bases:
FrequentistFitter
Scipy fitter using scipy.minimize.
Initializes the FrequentistFitter.
- Args:
- model (Model):
The parametric pmrf model to be fitted.
- measured (skrf.Network | list[skrf.Network]):
The measured network data to fit the model against.
- frequency (skrf.Frequency | None, optional):
The frequency axis to perform the fit on. Defaults to None.
- features (FeatureT | FeatureListT | None, optional),
The features to extract for comparison. Defaults to None.
- cost (ArrayFuncT | list[ArrayFuncT] | eqx.Module, optional):
A function or sequence of functions defining the cost metric. If a list of functions is provided, they are composed sequentially. If None, a default cost function (typically L2 norm on the dB magnitude difference) is used. Defaults to None.
- Parameters:
model (Model)
measured (Network | dict[str, Network])
frequency (Frequency | None)
features (str | tuple[str, str] | tuple[str, str, tuple[int, int]] | Sequence[str | tuple[str, str] | tuple[str, str, tuple[int, int]]] | dict[str, str | tuple[str, str] | tuple[str, str, tuple[int, int]] | Sequence[str | tuple[str, str] | tuple[str, str, tuple[int, int]]]] | None)
cost (Callable[[Array], Array] | list[Callable[[Array], Array]] | Module)
- __init__(model, measured, frequency=None, features=None, cost=None, *args, **kwargs)
Initializes the FrequentistFitter.
- Args:
- model (Model):
The parametric pmrf model to be fitted.
- measured (skrf.Network | list[skrf.Network]):
The measured network data to fit the model against.
- frequency (skrf.Frequency | None, optional):
The frequency axis to perform the fit on. Defaults to None.
- features (FeatureT | FeatureListT | None, optional),
The features to extract for comparison. Defaults to None.
- cost (ArrayFuncT | list[ArrayFuncT] | eqx.Module, optional):
A function or sequence of functions defining the cost metric. If a list of functions is provided, they are composed sequentially. If None, a default cost function (typically L2 norm on the dB magnitude difference) is used. Defaults to None.
- Parameters:
model (Model)
measured (Network | dict[str, Network])
frequency (Frequency | None)
features (str | tuple[str, str] | tuple[str, str, tuple[int, int]] | Sequence[str | tuple[str, str] | tuple[str, str, tuple[int, int]]] | dict[str, str | tuple[str, str] | tuple[str, str, tuple[int, int]] | Sequence[str | tuple[str, str] | tuple[str, str, tuple[int, int]]]] | None)
cost (Callable[[Array], Array] | list[Callable[[Array], Array]] | Module)
- Return type:
None
Methods
__delattr__
(name, /)Implement delattr(self, name).
__dir__
()Default dir() implementation.
__eq__
(value, /)Return self==value.
__format__
(format_spec, /)Default object formatter.
__ge__
(value, /)Return self>=value.
__getattribute__
(name, /)Return getattr(self, name).
__getstate__
()Helper for pickle.
__gt__
(value, /)Return self>value.
__hash__
()Return hash(self).
__init__
(model, measured[, frequency, ...])Initializes the FrequentistFitter.
__init_subclass__
This method is called when a class is subclassed.
__le__
(value, /)Return self<=value.
__lt__
(value, /)Return self<value.
__ne__
(value, /)Return self!=value.
__new__
(*args, **kwargs)__reduce__
()Helper for pickle.
__reduce_ex__
(protocol, /)Helper for pickle.
__repr__
()Return repr(self).
__setattr__
(name, value, /)Implement setattr(self, name, value).
__sizeof__
()Size of object in memory, in bytes.
__str__
()Return str(self).
__subclasshook__
Abstract classes can override this to customize issubclass().
_bounds
()_make_cost_function
([as_numpy])_make_feature_function
([as_numpy])_settings
([solver_kwargs, fitter_kwargs])run
(**kwargs)Executes the fitting algorithm.
Attributes
__abstractmethods__
__annotations__
__dict__
__doc__
__module__
__slots__
__weakref__
list of weak references to the object
_abc_impl
- run(**kwargs)[source]
Executes the fitting algorithm.
This method must be implemented by all concrete subclasses. It is the main entry point to start the optimization or sampling process.
- Returns:
FitResults: An object containing the results of the fit.
- Return type:
- measured: skrf.Network | dict[str, skrf.Network]