pactools.dar_model.StableDAR

class pactools.dar_model.StableDAR(iter_newton=0, eps_newton=0.001, **kwargs)[source]

A stable driven auto-regressive (DAR) model, as described in [1]. This model is designed to have an stable instantaneous AR model at each time.

This model uses the parametrization:

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

with:

\[a_p^{(p)} = k_p; a_i^{(p)} = a_i^{(p-1)} + k_p a_{p-i}^{(p-1)}\]
\[\gamma_i = \log\left(\frac{1+k_i}{1-k_i}\right); \gamma_{i}(t)=\sum_{j=0}^{m}\gamma_{ij}x(t)^j\]

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. , Grenier, Y., & Gramfort, A. (2017). Parametric estimation of spectrum driven by an exogenous signal. Acoustics, Speech and Signal Processing (ICASSP), 2017 IEEE International Conference on, 4301–4305.

__init__(self, iter_newton=0, eps_newton=0.001, \*\*kwargs)

Creates a base Lattice model with Taylor expansion

iter_newton : maximum number of Newton-Raphson iterations eps_newton : threshold to stop Newton-Raphson iterations

Methods

__init__(self[, iter_newton, eps_newton])

Creates a base Lattice model with Taylor expansion

cell(self, parcor_list, forward_residual, …)

Apply a single cell of the direct lattice filter to whiten the original signal

copy(self)

Creates a (deep) copy of a model

decode(self, lar)

Extracts parcor coefficients from encoded version (e.g.

degrees_of_freedom(self)

Number of parameters of the fitted model

encode(self, ki)

Encodes parcor coefficients to LAR coefficients

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

synthesis(self[, sigdriv, sigin_init])

Create a signal from fitted model

synthesize(self, random_sig[, burn_in, newbasis])

Apply the inverse lattice filter to synthesize an AR signal

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

Whiten a signal with the already fitted model

whiten(self)

Apply the direct lattice filter to whiten the original signal

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