Skip to main content

Module causality

Module causality 

Source

Structsยง

C64 ๐Ÿ”’

Functionsยง

cmat_conj_t ๐Ÿ”’
Conjugate transpose of dร—d complex matrix.
cmat_det ๐Ÿ”’
Complex matrix determinant, dร—d.
cmat_inv ๐Ÿ”’
Complex matrix inverse via Gauss-Jordan, dร—d row-major.
cmat_mul ๐Ÿ”’
Complex matrix multiply: C = A * B, all dร—d row-major.
conditional_granger_causality
Conditional Granger causality (Geweke 1984). Tests if source Granger-causes target controlling for condition.
directed_transfer_function
Directed transfer function (Kaminski & Blinowska 1991). Returns (d ร— d ร— n_freqs) flat Vec.
identity_flat ๐Ÿ”’
pairwise_granger_causality
Pairwise Granger causality (Granger 1969). Returns log-likelihood ratio. Positive = source Granger-causes target.
partial_directed_coherence
Partial directed coherence (Baccala & Sameshima 2001). Returns (d ร— d ร— n_freqs) flat Vec.
solve_linear ๐Ÿ”’
Solve A x = b via Gaussian elimination with partial pivoting. A is nร—n (row-major flat), b is n-length. Returns x.
solve_matrix ๐Ÿ”’
Solve A X = B where A is nร—n and B is nร—m. Returns X (nร—m, row-major).
spectral_granger_causality
Spectral Granger causality (Geweke 1982). Returns (d ร— d ร— n_freqs) as flat Vec, row-major in [i][j][f] order.
sse_ols ๐Ÿ”’
Sum of squared errors for OLS regression: SSE = ||y - X beta||^2.
var_coefficients ๐Ÿ”’
Fit VAR(order) model. Returns (beta [order*d ร— d, row-major], sigma [dร—d, row-major]).