Skip to content

Bug: Analysis.m Granger causality ensCovMask zeroes wrong columns #15

@iahncajigas

Description

@iahncajigas

Bug Description

In Analysis.m line 1051, the Granger causality mask computation:

ensCovMaskTemp(neighbors(j), neuronNum) = 0;

This zeroes ALL columns indexed by neuronNum (the full neuron list) instead of just the specific neuron being tested neuronNum(i). This causes the Granger causality test to incorrectly exclude covariates for neurons that should still be included.

Expected Fix

ensCovMaskTemp(neighbors(j), neuronNum(i)) = 0;

Related

Additionally, lines 1063-1066 have a related issue where the phiMat computation via strfind/~isempty always indexes only the first coefficient rather than iterating properly.

Found during comprehensive cross-toolbox audit (Python nSTAT-python already handles this correctly).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions