pactools.dar_model.DAR

class pactools.dar_model.DAR(ordar=1, ordriv=0, criterion=None, normalize=True, ortho=True, center=True, iter_gain=10, eps_gain=0.0001, progress_bar=False, use_driver_phase=False, max_ordar=None, warn_gain_estimation_failure=False)[source]

A driven auto-regressive (DAR) model, as described in [1].

This model uses the simple parametrization:

\[y(t) + \sum_{i=1}^p a_i(t) y(t-i)= \sigma(t)\varepsilon(t)\]

with:

\[a_i(t) = \sum_{k=0}^m a_{ik} x(t)^k\]

and:

\[\log{\sigma(t)} = \sum_{k=0}^m b_{k} x(t)^k\]
Parameters
ordarint >= 0

Order of the autoregressive model (p)

ordrivint >= 0

Order of the taylor expansion for sigdriv (m)

criterionNone or string in (‘bic’, ‘aic’, ‘logl’)

If not None, select the criterion used for model selection.

normalizeboolean

If True, the basis vectors are normalized to unit energy.

orthoboolean

If True, the basis vectors are orthogonalized.

centerboolean

If True, we subtract the mean in sigin

iter_gainint >=0

Maximum number of iteration in gain estimation

eps_gainfloat >= 0

Threshold to stop iterations in gain estimation

use_driver_phaseboolean

If True, we divide the driver by its instantaneous amplitude.

References

[1] Dupre la Tour, T. , Tallot, L., Grabot, L., Doyere, V., van Wassenhove, V., Grenier, Y., & Gramfort, A. (2017). Non-linear Auto-Regressive Models for Cross-Frequency Coupling in Neural Time Series. bioRxiv, 159731.

__init__(self, ordar=1, ordriv=0, criterion=None, normalize=True, ortho=True, center=True, iter_gain=10, eps_gain=0.0001, progress_bar=False, use_driver_phase=False, max_ordar=None, warn_gain_estimation_failure=False)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(self[, ordar, ordriv, criterion, …])

Initialize self.

copy(self)

Creates a (deep) copy of a model

degrees_of_freedom(self)

Number of parameters of the fitted model

fit(self, sigin, sigdriv, fs[, …])

Estimate the model from input signals

fit_transform(self, sigin, sigdriv, fs[, …])

Same as fit, but returns the residual instead of the model object

get_criterion(self, criterion[, train])

Get the criterion (logL, AIC, BIC) of the fitted model

get_title(self[, name, criterion])

Get the name and orders of the model

likelihood_ratio(self, ar0)

Computation of the likelihood ratio test

plot(self[, title, frange, mode, vmin, …])

Plot the PSD as a function of the driver

plot_lines(self[, title, frange, mode, ax, …])

Plot the PSD as a function of the driver

transform(self, sigin, sigdriv, fs[, …])

Whiten a signal with the already fitted model

Attributes

aic

Akaike information criterion (AIC) of the model

bic

Bayesian information criterion (BIC) of the model

logl

Log likelihood of the model

ordar_

AR order of the model, different from self.ordar if a model selection has been performed

tmax

Scaling of self.logl, self.aic, and self.bic