dirconn.Estimator#

class dirconn.Estimator#

Base class for all directed-connectivity estimators.

A concrete estimator is a frozen dataclass whose fields are its typed parameters, with a class attribute info (a MethodInfo) and a _fit method:

@dataclass(frozen=True)
class Granger(Estimator):
    info = MethodInfo(name="granger", backend="own numpy OLS MVAR", directed=True)
    order: int = 5

    def _fit(self, data: TimeSeries) -> Connectivity: ...

Using a dataclass means unknown keyword arguments raise TypeError, parameters have types and defaults the IDE can show, and an estimator never changes after construction. Subclasses that override __post_init__ must call super().__post_init__().

fit() is stateless: it returns the result and the estimator keeps nothing.

__init__()#

Methods

__init__()

fit(data)

Estimate directed connectivity.

get_params()

Return the constructor parameters as a dictionary.

Attributes

info