v2.0.0
Loading...
Searching...
No Matches
CONNLIB::MvarModel Class Reference

MVAR model fitting for directed connectivity metrics. More...

#include <mvar_model.h>

Public Member Functions

 MvarModel ()=default
void fit (const Eigen::MatrixXd &data, int p=0)
QVector< Eigen::MatrixXd > coefficients () const
Eigen::MatrixXd noiseCov () const
int order () const
QVector< Eigen::MatrixXcd > transferFunction (const Eigen::VectorXd &freqs) const
QVector< Eigen::MatrixXcd > spectralMatrix (const Eigen::VectorXd &freqs) const

Detailed Description

MVAR model fitting for directed connectivity metrics.

Multivariate autoregressive (MVAR) model fitting and spectral decomposition.

Fits an MVAR model of order p to multi-channel time-series data and provides the transfer function H(f) and spectral matrix S(f) used by directed connectivity metrics (Granger Causality, DTF, PDC).

Since
2.2.0

Definition at line 81 of file mvar_model.h.

Constructor & Destructor Documentation

◆ MvarModel()

CONNLIB::MvarModel::MvarModel ( )
default

Constructs a default MvarModel object.

Member Function Documentation

◆ coefficients()

QVector< MatrixXd > MvarModel::coefficients ( ) const

Returns the fitted coefficient matrices A_1 .. A_p (each nChannels x nChannels).

Returns
The MVAR coefficient matrices.
Since
2.2.0

Definition at line 82 of file mvar_model.cpp.

◆ fit()

void MvarModel::fit ( const Eigen::MatrixXd & data,
int p = 0 )

Fits an MVAR model of order p to multi-channel data.

Parameters
[in]dataThe input data matrix (nChannels x nSamples).
[in]pThe model order. If 0, the order is auto-selected via BIC.
Since
2.2.0

Definition at line 69 of file mvar_model.cpp.

◆ noiseCov()

MatrixXd MvarModel::noiseCov ( ) const

Returns the noise covariance matrix (nChannels x nChannels).

Returns
The noise covariance matrix.
Since
2.2.0

Definition at line 89 of file mvar_model.cpp.

◆ order()

int MvarModel::order ( ) const

Returns the fitted model order.

Returns
The model order p.
Since
2.2.0

Definition at line 96 of file mvar_model.cpp.

◆ spectralMatrix()

QVector< MatrixXcd > MvarModel::spectralMatrix ( const Eigen::VectorXd & freqs) const

Computes the spectral matrix S(f) = H(f) * Sigma * H(f)^H.

Parameters
[in]freqsVector of normalized frequencies in [0, 0.5].
Returns
Vector of nChannels x nChannels complex matrices, one per frequency.
Since
2.2.0

Definition at line 129 of file mvar_model.cpp.

◆ transferFunction()

QVector< MatrixXcd > MvarModel::transferFunction ( const Eigen::VectorXd & freqs) const

Computes the transfer function H(f) at the given normalized frequencies.

H(f) = (I - sum_{k=1}^{p} A_k * exp(-2*pi*i*f*k))^{-1}

Parameters
[in]freqsVector of normalized frequencies in [0, 0.5].
Returns
Vector of nChannels x nChannels complex matrices, one per frequency.
Since
2.2.0

Definition at line 103 of file mvar_model.cpp.


The documentation for this class was generated from the following files: