brainmass.objectives.fcd_distribution

brainmass.objectives.fcd_distribution#

brainmass.objectives.fcd_distribution(fcd_matrix, midpoints=None, n_diag=1, bw_method=None, normalize=True)[source]#

Kernel-density estimate of the FCD off-diagonal value distribution.

The standard FCD fitting target is the distribution of the upper-triangle (off-diagonal) values of the FCD matrix – not the matrix itself. This surfaces that distribution as a smooth density on a fixed grid via jax.scipy.stats.gaussian_kde() (delegated; braintools provides no KDE).

Parameters:
  • fcd_matrix (array) – Square FCD matrix (e.g. from fcd() or braintools.metric.functional_connectivity_dynamics()).

  • midpoints (array, optional) – Evaluation grid. Default: 100 points on [-0.99, 0.99] (FCD values are correlations).

  • n_diag (int, default 1) – Diagonal offset for the upper-triangle extraction (1 excludes the main diagonal).

  • bw_method (optional) – Bandwidth selector forwarded to jax.scipy.stats.gaussian_kde() (default None = Scott’s rule). Smaller values give sharper densities.

  • normalize (bool, default True) – Renormalise the evaluated density to integrate to 1 over midpoints (KDE on a finite grid never integrates to exactly 1).

Returns:

Density evaluated on midpoints.

Return type:

jax.Array