References¶
Published sources for the methods jnwb implements. Each row names the result jnwb implements and the functions that implement it, and each of those functions cites the same DOI in its docstring; a test holds the two to each other. Each DOI was checked against its Crossref or DataCite record, and each ISBN on Open Library; the check dates are in this file's git history. Each row gives the record's year, and names an edition only where the record does. Where jnwb departs from the published result, the row and the docstring say how. The Pitfalls table lists papers that state a pitfall rather than a method jnwb implements; the functions it names are those the pitfall concerns, and their docstrings do not cite it.
Signal processing¶
| Reference | Result implemented | Functions |
|---|---|---|
| Welch, P. D. (1967). The use of fast Fourier transform for the estimation of power spectra: a method based on time averaging over short, modified periodograms. IEEE Transactions on Audio and Electroacoustics 15(2), 70-73. doi:10.1109/TAU.1967.1161901 | The use of fast Fourier transform for the estimation of power spectra. The spectrum as the average of windowed periodograms over overlapping segments | compute_psd, band_power, spectral_tilt, harmonic_analysis, imaginary_coherency, cross_area_coherence, vflip_from_lfp |
| Thomson, D. J. (1982). Spectrum estimation and harmonic analysis. Proceedings of the IEEE 70(9), 1055-1096. doi:10.1109/PROC.1982.12433 | Spectrum estimation and harmonic analysis. The multitaper estimate: periodograms under orthogonal Slepian (DPSS) tapers, combined across tapers. jnwb averages the K eigenspectra with equal weight | compute_multitaper_psd |
| Torrence, C., & Compo, G. P. (1998). A practical guide to wavelet analysis. Bulletin of the American Meteorological Society 79(1), 61-78. doi:10.1175/1520-0477(1998)079<0061:APGTWA>2.0.CO;2 | A practical guide to wavelet analysis. The Morlet wavelet, unit-energy normalization and the cone of influence. jnwb's default normalization is its own amplitude scaling; normalization='energy' gives unit energy. The default masks every sample the kernel's zero padding reaches, which is wider, and coi_sigma=np.sqrt(2) gives the paper's cone |
complex_tfr, morlet_wavelet |
| Donoghue, T., et al. (2020). Parameterizing neural power spectra into periodic and aperiodic components. Nature Neuroscience 23(12), 1655-1665. doi:10.1038/s41593-020-00744-x | Parameterizing neural power spectra into periodic and aperiodic components. aperiodic_fit fits the aperiodic form \(L(f) = b - \log_{10}(k + f^\chi)\); the fixed mode is \(k = 0\). By default it fits every bin in the range and removes no peaks |
aperiodic_fit |
| Virtanen, P., et al. (2020). SciPy 1.0: fundamental algorithms for scientific computing in Python. Nature Methods 17(3), 261-272. doi:10.1038/s41592-019-0686-2 | The scipy.signal routines jnwb filters through: Butterworth SOS design with zero-phase or causal application, and notch design with SOS conversion. The paper describes the library, not these filters |
bandpass_filter, notch_filter |
Laminar analysis¶
| Reference | Result implemented | Functions |
|---|---|---|
| Mendoza-Halliday, D., et al. (2024). A ubiquitous spectrolaminar motif of local field potential power across the primate cortex. Nature Neuroscience 27(3), 547-560. doi:10.1038/s41593-023-01554-7 | A ubiquitous spectrolaminar motif of local field potential power across the primate cortex. vflip tests for that motif: gamma power peaking in superficial channels, alpha-beta in deep ones, with their crossover at layer 4. It shares its name with the paper's FLIP and vFLIP, not their procedure: it normalizes by the range across contacts, uses fixed default bands (8-30 Hz and 50-150 Hz) and scores the fit by its own support score |
vflip_from_lfp, vflip, label_layers; the 10-19 Hz and 75-150 Hz motif bands of curate_and_label |
| Bastos, A. M., et al. (2018). Laminar recordings in frontal cortex suggest distinct layers for maintenance and control of working memory. PNAS 115(5), 1117-1122. doi:10.1073/pnas.1710323115 | Laminar recordings in frontal cortex. vflip averages power at each frequency relative to the other contacts into low-band and high-band depth profiles and takes their crossover; it uses 8-30 Hz and 50-150 Hz by default and rescales each profile before finding the crossing |
vflip_from_lfp, vflip |
| Bastos, A. M., et al. (2021). Neural effects of propofol-induced unconsciousness and its reversal using thalamic stimulation. eLife 10, e60824. doi:10.7554/eLife.60824 | Materials and methods, "Neural recordings in cortex": the crossover of the gamma and alpha-beta relative power profiles as the estimate of layer 4. The paper gives no normalization for it beyond citing Bastos et al. (2018) and describes no acceptance test; vflip rejects a fit whose support score is below min_support_score |
vflip_from_lfp |
| Mitzdorf, U. (1985). Current source-density method and application in cat cerebral cortex: investigation of evoked potentials and EEG phenomena. Physiological Reviews 65(1), 37-100. doi:10.1152/physrev.1985.65.1.37 | Current source-density method and application in cat cerebral cortex. The evoked CSD as the negative second spatial derivative of the potential along the shaft, a sink being a negative value | evoked_csd_sink |
| Nicholson, C., & Freeman, J. A. (1975). Theory of current source-density analysis and determination of conductivity tensor for anuran cerebellum. Journal of Neurophysiology 38(2), 356-368. doi:10.1152/jn.1975.38.2.356 | Theory of current source-density analysis. Current source density as \(-\sigma\,\partial^2\phi/\partial z^2\) in one dimension, by the three-point second difference. current_source_density_1d scales that difference by the conductivity; voltage_curvature_1d is the difference without \(\sigma\); laplacian_reference is data minus the neighbor mean (interior: -1/2 times that difference, no pitch or conductivity scaling) with single-neighbor edges, keeping every channel |
current_source_density_1d, voltage_curvature_1d, laplacian_reference |
| Major, A. J., et al. (2025). A. J. Major et al. reply. Nature Neuroscience 29(2), 284-286. doi:10.1038/s41593-025-02168-x | vFLIP2's motif estimator: the low- and high-frequency ranges with maximal laminar power gradients, each scored by omega, and acceptance at omega above 6. vflip2 ports the MATLAB code; where the description differs from the code, the port follows the code |
vflip2 |
| Mendoza-Halliday, D., et al. (2023). (variable) Frequency-based Layer Identification Procedure (FLIP and vFLIP) for spectrolaminar analysis, version 8 (2025-11-04). Dryad dataset. doi:10.5061/dryad.9w0vt4bnp | The version-8 dataset holding the vFLIP2.m MATLAB code (CC0), which vflip2 ports, and PSDs from raw or trial-cut LFP, which vflip2_from_lfp ports; their numbers match vFLIP2.m run in MATLAB on the same inputs |
vflip2, vflip2_from_lfp |
The published estimator for the motif is vFLIP2: Major, A. J., et al. (2025). A. J. Major et al.
reply. Nature Neuroscience 29(2), 284-286.
doi:10.1038/s41593-025-02168-x. vflip2 ports
its MATLAB code, vFLIP2.m (Mendoza-Halliday, D., et al., Dryad
doi:10.5061/dryad.9w0vt4bnp, version 8, CC0), and
returns its omega and acceptance. VFlipResult.support_score is jnwb's own score, not vFLIP2's
omega, so vFLIP2's acceptance tiers do not apply to it.
Coherence and phase¶
| Reference | Result implemented | Functions |
|---|---|---|
| Nolte, G., et al. (2004). Identifying true brain interaction from EEG data using the imaginary part of coherency. Clinical Neurophysiology 115(10), 2292-2307. doi:10.1016/j.clinph.2004.04.029 | Identifying true brain interaction from EEG data using the imaginary part of coherency. The imaginary part of coherency, on the cross-spectrum E[X conj(Y)], the conjugate of what scipy.signal.csd returns. A lead of x over y gives a positive value, the convention phase_slope_index uses |
imaginary_coherency |
| Vinck, M., et al. (2011). An improved index of phase-synchronization for electrophysiological data in the presence of volume-conduction, noise and sample-size bias. NeuroImage 55(4), 1548-1565. doi:10.1016/j.neuroimage.2011.01.055 | An improved index of phase synchronization for electrophysiological data in the presence of volume conduction, noise and sample-size bias. The weighted phase lag index \(\lvert \sum \mathrm{Im}\,S \rvert / \sum \lvert \mathrm{Im}\,S \rvert\) over segment cross-spectra \(S\), weighted by the magnitude of the imaginary part, and the debiased estimator of squared wPLI | wpli, zflip |
| Vinck, M., et al. (2010). The pairwise phase consistency: a bias-free measure of rhythmic neuronal synchronization. NeuroImage 51(1), 112-122. doi:10.1016/j.neuroimage.2010.01.073 | A bias-free measure of rhythmic neuronal synchronization. The pairwise phase consistency, the mean cosine of phase differences over all pairs of observations, computed through the resultant as \((\lvert \sum e^{i\theta} \rvert^2 - N) / (N(N-1))\) | pairwise_phase_consistency |
| Dahlhaus, R. (2000). Graphical interaction models for multivariate time series. Metrika 51(2), 157-172. doi:10.1007/s001840000055 | Graphical interaction models for multivariate time series. The partial coherence \(\lvert G_{xy} \rvert^2 / (G_{xx} G_{yy})\) with \(G\) the inverse of the cross-spectral matrix, here the Welch estimate (partial_coherence) |
partial_coherence |
| Maris, E., Schoffelen, J.-M., & Fries, P. (2007). Nonparametric statistical testing of coherence differences. Journal of Neuroscience Methods 163(1), 161-175. doi:10.1016/j.jneumeth.2007.02.011 | Nonparametric statistical testing of coherence differences. The coherence of trials paired across epochs as the level unrelated trials give; jnwb draws uniform derangements of the trial order (coherence_bias_floor) |
coherence_bias_floor |
| Bastos, A. M., et al. (2020). Layer and rhythm specificity for predictive routing. PNAS 117(49), 31459-31469. doi:10.1073/pnas.2014868117 | Experimental Procedures, "Local Field Potential Power, Coherence, and Granger Causality Analysis": sample-by-sample bipolar differences taken before coherence and Granger causality, because a common reference can make both spurious. Its Granger causality is the nonparametric estimate from the multitaper cross-spectral matrix, which jnwb does not implement; granger_spectral fits a VAR. bipolar_reference subtracts adjacent contacts |
bipolar_reference |
| Berens, P. (2009). CircStat: a MATLAB toolbox for circular statistics. Journal of Statistical Software 31(10). doi:10.18637/jss.v031.i10 | CircStat, a MATLAB toolbox for circular statistics. The Rayleigh test of circular non-uniformity (z = nR^2), as circ_rtest computes it. jnwb's p-value, exp(-z)(1 + (2z - z^2)/4n), truncates after its first-order term; circ_rtest itself uses the Zar approximation. The histogram contrast is jnwb's own |
phase_locking_index |
Directed connectivity¶
| Reference | Result implemented | Functions |
|---|---|---|
| Granger, C. W. J. (1969). Investigating causal relations by econometric models and cross-spectral methods. Econometrica 37(3), 424. doi:10.2307/1912791 | Investigating causal relations by econometric models and cross-spectral methods. Granger causality: X Granger-predicts Y when the past of X improves the prediction of Y beyond the past of Y, a temporal-lag asymmetry rather than a causal effect | granger |
| Geweke, J. (1982). Measurement of linear dependence and feedback between multiple time series. Journal of the American Statistical Association 77(378), 304-313. doi:10.1080/01621459.1982.10477803 | Measurement of linear dependence and feedback between multiple time series. The measure of linear feedback, the log ratio of restricted to unrestricted residual variance, and its frequency decomposition through the transfer function of the fitted VAR | granger, granger_spectral |
| Geweke, J. F. (1984). Measures of conditional linear dependence and feedback between time series. Journal of the American Statistical Association 79(388), 907-915. doi:10.1080/01621459.1984.10477110 | Measures of conditional linear dependence and feedback between time series. The conditional measure: the past of Z enters both the restricted and the unrestricted model (Z=; every other node under directed_network(conditional=True)) |
granger, directed_network |
| Lütkepohl, H. (2005). New Introduction to Multiple Time Series Analysis. Springer. doi:10.1007/978-3-540-27752-1 | New Introduction to Multiple Time Series Analysis. VAR order selection: AIC, HQ and SC from the maximum-likelihood residual variance, every candidate order fitted to the same sample. jnwb scores the equation of the predicted signal rather than the full residual covariance | granger |
| Nolte, G., et al. (2008). Robustly estimating the flow direction of information in complex physical systems. Physical Review Letters 100(23), 234101. doi:10.1103/PhysRevLett.100.234101 | Robust estimation of the direction of information flow in complex physical systems. The phase slope index, positive when X leads Y, from the slope of the coherency phase. z is jnwb's normalization (psi over its jackknife standard deviation). Its jackknife leaves out one trial from three trials on and one Welch segment below that |
phase_slope_index |
| Schreiber, T. (2000). Measuring information transfer. Physical Review Letters 85(2), 461-464. doi:10.1103/PhysRevLett.85.461 | Transfer entropy, eq. 4, with target history k and source history l |
transfer_entropy |
| Marschinski, R., & Kantz, H. (2002). Analysing the information flow between financial time series. The European Physical Journal B 30(2), 275-281. doi:10.1140/epjb/e2002-00379-2 | Information flow between time series. Effective transfer entropy: the raw value minus the mean over surrogates (bias_corrected_*). jnwb's surrogates permute trials or circularly shift the source, keeping its autocorrelation |
transfer_entropy |
| Wilson, G. T. (1972). The factorization of matricial spectral densities. SIAM Journal on Applied Mathematics 23(4), 420-426. doi:10.1137/0123044 | The factorization of matricial spectral densities. The causal factor \(S = \Psi \Psi^{*}\) of a spectral density matrix, by Wilson's iteration to a residual tolerance; non-convergence raises | granger_nonparametric |
| Dhamala, M., Rangarajan, G., & Ding, M. (2008). Estimating Granger causality from Fourier and wavelet transforms of time series data. Physical Review Letters 100(1), 018701. doi:10.1103/PhysRevLett.100.018701 | Granger causality estimated from Fourier transforms of time series data, without a VAR fit. Geweke's spectral measure from the factor of an estimated cross-spectral matrix. jnwb estimates that matrix by Welch's method (granger_nonparametric) |
granger_nonparametric |
| Haufe, S., Nikulin, V. V., Müller, K.-R., & Nolte, G. (2013). A critical assessment of connectivity measures for EEG data: a simulation study. NeuroImage 64, 120-133. doi:10.1016/j.neuroimage.2012.09.036 | A critical assessment of connectivity measures for EEG data. Granger causality on time-reversed signals as a control (granger_time_reversed) |
granger_time_reversed |
| Winkler, I., Panknin, D., Bartz, D., Müller, K.-R., & Haufe, S. (2016). Validity of time reversal for testing Granger causality. IEEE Transactions on Signal Processing 64(11), 2746-2760. doi:10.1109/TSP.2016.2531628 | Validity of time reversal for testing Granger causality. The sign rule of the reversal test: a net direction that changes sign under time reversal supports the directed claim; one that keeps its sign declines it (granger_time_reversed) |
granger_time_reversed |
Information measures¶
| Reference | Result implemented | Functions |
|---|---|---|
| Shannon, C. E. (1948). A mathematical theory of communication. Bell System Technical Journal 27(3), 379-423. doi:10.1002/j.1538-7305.1948.tb01338.x | A mathematical theory of communication. Discrete mutual information from the empirical joint distribution of the binned trains, in bits. A plug-in estimate on finite bins with no bias correction, of bin occupancy or per-bin counts rather than the full trains | spike_mutual_information |
Statistics¶
| Reference | Result implemented | Functions |
|---|---|---|
| Maris, E., & Oostenveld, R. (2007). Nonparametric statistical testing of EEG- and MEG-data. Journal of Neuroscience Methods 164(1), 177-190. doi:10.1016/j.jneumeth.2007.03.024 | Nonparametric statistical testing of EEG- and MEG-data. The cluster-based permutation test: clusters of adjacent points above a threshold, the sum of \(t\) within each cluster as its statistic, and significance against the permutation distribution of the largest cluster statistic | cluster_permutation_test |
| Phipson, B., & Smyth, G. K. (2010). Permutation p-values should never be zero: calculating exact p-values when permutations are randomly drawn. Statistical Applications in Genetics and Molecular Biology 9(1). doi:10.2202/1544-6115.1585 | Permutation p-values that are never zero when permutations are randomly drawn. The Monte Carlo p-value \((1 + b) / (B + 1)\) over \(B\) random permutations, doubled from the smaller tail and capped at 1 when two-sided; exact_sign_flip uses it only above N = 20 and at N <= 20 enumerates every flip, p = count / 2^N |
cluster_permutation_test, exact_sign_flip, shuffle_pvalue_paired, shuffle_pvalue_unpaired, paired_fire_prob_test |
| Benjamini, Y., & Hochberg, Y. (1995). Controlling the false discovery rate: a practical and powerful approach to multiple testing. Journal of the Royal Statistical Society Series B 57(1), 289-300. doi:10.1111/j.2517-6161.1995.tb02031.x | Controlling the false discovery rate: a practical and powerful approach to multiple testing. The step-up procedure, returned as adjusted p-values (method='bh', through scipy.stats.false_discovery_control) |
fdr_correct, StatisticalAnalysis.fdr_correct, directed_network |
| Benjamini, Y., & Yekutieli, D. (2001). The control of the false discovery rate in multiple testing under dependency. The Annals of Statistics 29(4). doi:10.1214/aos/1013699998 | The control of the false discovery rate in multiple testing under dependency. The step-up procedure under arbitrary dependence (method='by') |
fdr_correct, StatisticalAnalysis.fdr_correct, directed_network |
| Przyborowski, J., & Wilenski, H. (1940). Homogeneity of results in testing samples from Poisson series: with an application to testing clover seed for dodder. Biometrika 31(3/4), 313-323. doi:10.2307/2332612 | Homogeneity of results in testing samples from Poisson series. The conditional test of two Poisson counts: given their total \(N\), the first is Binomial(\(N\), \(d_r/(d_r+d_b)\)) under equal rates, with \(d_r\), \(d_b\) the exposures. jnwb sums counts and window durations over trials and takes the two-sided p from scipy.stats.binomtest |
classify_response_significance |
| Clopper, C. J., & Pearson, E. S. (1934). The use of confidence or fiducial limits illustrated in the case of the binomial. Biometrika 26(4), 404-413. doi:10.1093/biomet/26.4.404 | The use of confidence or fiducial limits illustrated in the case of the binomial. The exact binomial confidence interval, computed from Beta quantiles | clopper_pearson, StatisticalAnalysis.clopper_pearson |
| Pitman, E. J. G. (1937). Significance tests which may be applied to samples from any populations. Journal of the Royal Statistical Society Series B 4(1), 119-130. doi:10.2307/2984124 | Significance tests which may be applied to samples from any populations. The paired permutation (sign-flip) null over all 2^N sign assignments. jnwb enumerates it exactly at N <= 20 and draws Monte Carlo sign-flips above that, with the Phipson and Smyth (2010) p-value | exact_sign_flip, shuffle_pvalue_paired, paired_fire_prob_test |
| Mann, H. B., & Whitney, D. R. (1947). On a test of whether one of two random variables is stochastically larger than the other. The Annals of Mathematical Statistics 18(1), 50-60. doi:10.1214/aoms/1177730491 | On a test of whether one of two random variables is stochastically larger than the other. The rank-permutation null: the extreme allocation has probability 1/comb(n1+n2, n1), doubled for the two-sided floor and capped at 1. jnwb reports this attainable-p floor only, not the U test | mann_whitney_p_floor |
| Efron, B. (1979). Bootstrap methods: another look at the jackknife. The Annals of Statistics 7(1). doi:10.1214/aos/1176344552 | Bootstrap methods: another look at the jackknife. The nonparametric bootstrap, resampling with replacement; the percentile interval over the resamples is jnwb's choice and is not in this paper. Computed by compare_groups through its resampling helper. exploratory_compare only forwards there and strips the correction block; its p-values stay raw |
StatisticalAnalysis.exploratory_compare |
Spiking population measures¶
| Reference | Result implemented | Functions |
|---|---|---|
| Fleiss, J. L. (1971). Measuring nominal scale agreement among many raters. Psychological Bulletin 76(5), 378-382. doi:10.1037/h0031619 | Measuring nominal scale agreement among many raters. Kappa for many raters, \((\bar P - P_e) / (1 - P_e)\) over a table of rater counts per item and category | fleiss_kappa |
| Cohen, M. R., & Kohn, A. (2011). Measuring and interpreting neuronal correlations. Nature Neuroscience 14(7), 811-819. doi:10.1038/nn.2842 | Measuring and interpreting neuronal correlations. The spike-count correlation, the Pearson r of two units' spike counts, whose value depends on the counting window. The paper's \(r_{sc}\) is taken across trials; spike_count_correlation takes it across time bins of one window, so shared rate changes (signal correlation) raise it too |
spike_count_correlation, noise_correlation |
| de la Rocha, J., Doiron, B., Shea-Brown, E., Josić, K., & Reyes, A. (2007). Correlation between neural spike trains increases with firing rate. Nature 448(7155), 802-806. doi:10.1038/nature06028 | Correlation between neural spike trains increases with firing rate. At a fixed underlying correlation, the spike-count correlation rises with firing rate and counting window; noise_correlation reports each pair's geometric-mean count beside r |
noise_correlation |
| Churchland, M. M., et al. (2010). Stimulus onset quenches neural variability: a widespread cortical phenomenon. Nature Neuroscience 13(3), 369-378. doi:10.1038/nn.2501 | Stimulus onset quenches neural variability: a widespread cortical phenomenon. The Fano factor per unit, the across-trial variance over the mean of the count in a fixed window, summarized over units | fano_factor |
| Wagenaar, D. A., Pine, J., & Potter, S. M. (2006). An extremely rich repertoire of bursting patterns during the development of cortical cultures. BMC Neuroscience 7, 11. doi:10.1186/1471-2202-7-11 | An extremely rich repertoire of bursting patterns during the development of cortical cultures. Network bursts as periods of elevated population activity; jnwb detects them as runs of population rate at or above a threshold for at least a minimum duration and reports the fraction of spikes inside them | network_burst_index |
| Gerstein, G. L., & Kiang, N. Y.-S. (1960). An approach to the quantitative analysis of electrophysiological data from single neurons. Biophysical Journal 1(1), 15-28. doi:10.1016/s0006-3495(60)86872-5 | An approach to the quantitative analysis of electrophysiological data from single neurons. The post-stimulus time histogram: trial-averaged firing rate in time bins around onset. jnwb returns the full mean-plus-SEM rate curve in right-open millisecond bins, NaN with no onsets | raster_psth |
| Nawrot, M. P., Aertsen, A., & Rotter, S. (1999). Single-trial estimation of neuronal firing rates: from single-neuron spike trains to population activity. Journal of Neuroscience Methods 94(1), 81-92. doi:10.1016/s0165-0270(99)00127-2 | Single-trial estimation of neuronal firing rates by kernel smoothing. jnwb smooths already-binned rates rather than spike times: a finite 5-tau exponential or a past-only truncated Gaussian (whose exact centroid is returned as the mean lag) with left-edge padding, or a symmetric acausal Gaussian through scipy. The past-only Gaussian is jnwb's own | causal_exp_smooth, causal_gaussian_smooth, gaussian_smooth_rate |
Unit quality¶
waveform_flatness and spatial_derivative_sharpness have no published source; their
thresholds are the caller's.
| Reference | Result implemented | Functions |
|---|---|---|
| Siegle, J. H., et al. (2021). Survey of spiking in the mouse visual system reveals functional hierarchy. Nature 592(7852), 86-92. doi:10.1038/s41586-020-03171-x | A survey of spiking in the mouse visual system. Unit quality metrics: the peak channel as the channel of maximum amplitude (peak minus trough); waveform duration as the difference in time between its peak and trough, taken from the larger extremum to the opposite one after it, as waveform_features does; SNR as the amplitude over twice the standard deviation of the residual waveforms; presence ratio as the fraction of blocks holding a spike. presence_ratio takes the caller's blocks |
waveform_features, waveform_snr, presence_ratio |
| Jia, X., et al. (2019). High-density extracellular probes reveal dendritic backpropagation and facilitate neuron classification. Journal of Neurophysiology 121(5), 1831-1847. doi:10.1152/jn.00680.2018 | High-density extracellular probes reveal dendritic backpropagation and facilitate neuron classification. The peak-to-trough ratio, the amplitude of the peak over that of the trough, on the channel of largest amplitude; the half-width, the repolarization slope and the spread as waveform_features, waveform_halfwidth, repolarization_slope and waveform_spread compute them, with jnwb's defaults: the peak channel resampled by 200/82, a 20-sample fit for the slope, and for the spread every second channel within 16 of the peak, above 12 % of its amplitude, outliers beyond a modified z-score of 1.5 dropped. Time is jnwb's axis linspace(0, n / fs, m), an interval longer than the resampled trace's by m / (m - 1) (0.5 % at 82 samples), and channel 0 is never a spread site |
waveform_features, waveform_halfwidth, repolarization_slope, waveform_spread |
| Shinomoto, S., et al. (2009). Relating neuronal firing patterns to functional differentiation of cerebral cortex. PLoS Computational Biology 5(7), e1000433. doi:10.1371/journal.pcbi.1000433 | Relating neuronal firing patterns to functional differentiation of cerebral cortex. The coefficient of variation of the inter-spike intervals, their standard deviation over their mean; jnwb takes the unbiased (ddof=1) standard deviation, the variance rule of fano_factor |
isi_cv |
| Hill, D. N., Mehta, S. B., & Kleinfeld, D. (2011). Quality metrics to accompany spike sorting of extracellular signals. Journal of Neuroscience 31(24), 8699-8705. doi:10.1523/JNEUROSCI.0971-11.2011 | Quality metrics to accompany spike sorting of extracellular signals. The fraction \(f\) of a unit's spikes from a contaminating source (refractory_contamination). The amplitude cut-off assumes a symmetric amplitude distribution: the upper tail of the smoothed 500-bin amplitude density beyond the bin, at or above its mode, whose density is closest to the lowest bin's, capped at 0.5 (amplitude_cutoff) |
refractory_contamination, amplitude_cutoff |
| Llobet, V., Wyngaard, A., & Barbour, B. (2022). Automatic post-processing and merging of multiple spike-sorting analyses with Lussac. bioRxiv preprint, version 1. doi:10.1101/2022.02.08.479192 | A derivation of the Hill et al. (2011) estimate (eq. 3), cited as the derivation only; jnwb computes the estimate as Hill et al. write it, with the plain recording duration | refractory_contamination |
| Cohen, J. (1960). A coefficient of agreement for nominal scales. Educational and Psychological Measurement 20(1), 37-46. doi:10.1177/001316446002000104 | A coefficient of agreement for nominal scales. Cohen's kappa, \((p_o - p_e) / (1 - p_e)\) over the 2x2 table of two labelings: the chance-corrected agreement the held-out screen reports beside balanced accuracy | screen_units_against_labels |
Waveform clustering¶
WaveMAP clusters normalized mean waveforms on UMAP's k-nearest-neighbor graph with Louvain.
The resolution is the Markov time of Lambiotte et al. (2008), the convention of the cylouvain
package the published code used: a larger resolution gives fewer clusters. Lee et al. (2021)
also cite Lambiotte (2007), Finding communities at different resolutions in large networks,
an Institute for Mathematical Sciences report with no DOI or arXiv identifier, for the same
convention.
| Reference | Result implemented | Functions |
|---|---|---|
| Lee, E. K., et al. (2021). Non-linear dimensionality reduction on extracellular waveforms reveals cell type diversity in premotor cortex. eLife 10, e67490. doi:10.7554/eLife.67490 | WaveMAP (Methods): the 1.6 ms window with 0.4 ms before the trough, per-unit normalization, Louvain on the UMAP graph with n_neighbors 20 and min_dist 0.1, the embedding used only for display, and the resolution chosen by modularity over 25 runs on 80% subsets (Fig. 3B). jnwb aligns at whole samples and does not exclude units; the published code also fixed the resolution at 1.5, and jnwb has no default | align_waveforms, normalize_waveforms, wavemap, wavemap_resolution_sweep |
| Lee, K., Carr, N., Perliss, A., & Chandrasekaran, C. (2023). WaveMAP for identifying putative cell types from in vivo electrophysiology. STAR Protocols 4(2), 102320. doi:10.1016/j.xpro.2023.102320 | Steps 9-10: subtract each waveform's mean, then divide each value by the maximum value in each row. jnwb divides by the row's largest absolute value instead, so a waveform whose trough outweighs its peak is scaled by the trough. The protocol's printed code transposes first, which would normalize each time point across units; jnwb normalizes each unit | normalize_waveforms, wavemap |
| McInnes, L., Healy, J., & Melville, J. (2018). UMAP: Uniform manifold approximation and projection for dimension reduction. arXiv 1802.03426. doi:10.48550/arXiv.1802.03426 | Uniform manifold approximation and projection for dimension reduction. The fuzzy simplicial set (the weighted k-nearest-neighbor graph) and the 2-d embedding, through umap-learn |
wavemap, wavemap_resolution_sweep |
| Blondel, V. D., Guillaume, J.-L., Lambiotte, R., & Lefebvre, E. (2008). Fast unfolding of communities in large networks. Journal of Statistical Mechanics 2008, P10008. doi:10.1088/1742-5468/2008/10/P10008 | Fast unfolding of communities in large networks. Louvain modularity optimization, through networkx.community.louvain_communities |
wavemap, wavemap_resolution_sweep |
| Lambiotte, R., Delvenne, J.-C., & Barahona, M. (2008). Laplacian dynamics and multiscale modular structure in networks. arXiv 0812.1770. doi:10.48550/arXiv.0812.1770 | The Markov-time resolution t. The linearized stability \(Q_{NL}(t)\) is equivalent up to a linear transformation to the tuneable Hamiltonian of Reichardt and Bornholdt, whose null-model term is then weighted 1/t; jnwb passes resolution=1/t to networkx |
wavemap, wavemap_resolution_sweep |
Representational analysis¶
| Reference | Result implemented | Functions |
|---|---|---|
| Kriegeskorte, N., et al. (2008). Representational similarity analysis: connecting the branches of systems neuroscience. Frontiers in Systems Neuroscience 2, 4. doi:10.3389/neuro.06.004.2008 | Representational similarity analysis: connecting the branches of systems neuroscience. Dissimilarity matrices of correlation distance, compared by Spearman rank correlation; their relatedness is tested by permuting condition labels | rdm, rdm_similarity, jrsa |
| Gretton, A., et al. (2005). Measuring statistical dependence with Hilbert-Schmidt norms. Lecture Notes in Computer Science, 63-77. doi:10.1007/11564089_7 | Measuring statistical dependence with Hilbert-Schmidt norms. The empirical HSIC \((m-1)^{-2}\,\mathrm{tr}(KHLH)\) with a Gaussian kernel (metric='hsic') |
jrsa |
| Kornblith, S., et al. (2019). Similarity of neural network representations revisited. arXiv:1905.00414. doi:10.48550/arXiv.1905.00414 | Similarity of neural network representations revisited. Linear CKA \(\lVert Y^\top X \rVert_F^2 / (\lVert X^\top X \rVert_F \lVert Y^\top Y \rVert_F)\) on column-centered \(X\) and \(Y\) (metric='cka') |
jrsa |
| Robert, P., & Escoufier, Y. (1976). A unifying tool for linear multivariate statistical methods: the RV-coefficient. Applied Statistics 25(3), 257. doi:10.2307/2347233 | A unifying tool for linear multivariate statistical methods: the RV-coefficient. The RV coefficient (metric='rv'). On column-centered data it equals linear CKA, and jnwb computes both by one formula |
jrsa |
| Székely, G. J., Rizzo, M. L., & Bakirov, N. K. (2007). Measuring and testing dependence by correlation of distances. The Annals of Statistics 35(6). doi:10.1214/009053607000000505 | Measuring and testing dependence by correlation of distances. The empirical distance correlation (metric='distance_correlation'); jnwb returns NaN for a constant sample |
jrsa |
| Cunningham, J. P., & Yu, B. M. (2014). Dimensionality reduction for large-scale neural recordings. Nature Neuroscience 17(11), 1500-1509. doi:10.1038/nn.3776 | Dimensionality reduction for large-scale neural recordings. PCA as a population-trajectory method. jnwb runs standardized correlation PCA (units z-scored before SVD, so each contributes equally regardless of rate), not covariance PCA; the review surveys the method rather than specifying this pipeline | compute_population_trajectory |
| Varma, S., & Simon, R. (2006). Bias in error estimation when using cross-validation for model selection. BMC Bioinformatics 7(1). doi:10.1186/1471-2105-7-91 | Bias in error estimation when using cross-validation for model selection. The nested scheme this implements: the inner search selects C on inner folds and error is estimated on held-out outer folds, so selection does not optimistically bias the reported accuracy | nested_cv_linear_svm |
| Cortes, C., & Vapnik, V. (1995). Support-vector networks. Machine Learning 20(3), 273-297. doi:10.1007/bf00994018 | Support-vector networks. The linear maximum-margin classifier, run here as scikit-learn's SVC(kernel='linear') with an inner GridSearchCV over C, not the paper's training algorithm | nested_cv_linear_svm |
Artifact detection and repair¶
| Reference | Result implemented | Functions |
|---|---|---|
| Bigdely-Shamlo, N., et al. (2015). The PREP pipeline: standardized preprocessing for large-scale EEG analysis. Frontiers in Neuroinformatics 9. doi:10.3389/fninf.2015.00016 | The PREP pipeline: standardized preprocessing for large-scale EEG analysis. Correlation-based bad-channel and bad-trial screening with robust statistics. jnwb flags median off-diagonal correlation as a robust-z low outlier against the other channels (or trials), not PREP's criteria; the cross-channel consensus that decides exclusion is jnwb's | channel_correlation_matrix, bad_channels_from_correlation, trial_correlation_matrix, bad_trials_single_channel |
| Leys, C., et al. (2013). Detecting outliers: do not use standard deviation around the mean, use absolute deviation around the median. Journal of Experimental Social Psychology 49(4), 764-766. doi:10.1016/j.jesp.2013.03.013 | Detecting outliers: do not use standard deviation around the mean, use absolute deviation around the median. Outlier detection by absolute deviation around the median (MAD x1.4826), not SD around the mean. jnwb's thresholds, pooled global scales and one-sided defaults are its own; the cross-trial median substitution of flagged cells is not the paper's | bad_channels_from_correlation, bad_trials_single_channel, detect_band_outliers, repair_band_artifacts, repair_lfp_trials |
Core texts¶
Textbooks that the implemented methods follow, with the topic jnwb takes from each.
| Reference | What jnwb follows from it | Functions |
|---|---|---|
| Oppenheim, A. V., & Willsky, A. S. (1997). Signals & systems, 2nd ed. Prentice Hall. ISBN 9780138147570. | Convolution, sampling and filtering, as the filter functions follow them | jnwb.bandpass_filter, jnwb.notch_filter, jnwb.complex_tfr |
| Oppenheim, A. V., & Schafer, R. W. (2010). Discrete-time signal processing, 3rd ed. Pearson. ISBN 9780131988422. | The discrete Fourier transform, windowing and filter design, as the spectral and filter functions follow them | jnwb.compute_psd, jnwb.bandpass_filter, jnwb.notch_filter |
| Percival, D. B., & Walden, A. T. (1993). Spectral analysis for physical applications: multitaper and conventional univariate techniques. Cambridge University Press. ISBN 9780521435413. | Slepian (DPSS) tapers and the multitaper spectral estimate | jnwb.compute_multitaper_psd |
| Bendat, J. S., & Piersol, A. G. (2010). Random Data Analysis And Measurement Procedures. John Wiley & Sons. ISBN 9780470248775. | Spectral estimates and the coherence function of random data | jnwb.compute_psd, jnwb.cross_area_coherence |
| Mitra, P., & Bokil, H. (2007). Observed Brain Dynamics. Oxford University Press, USA. ISBN 9780195178081. | Multitaper spectra and coherence of neural time series | jnwb.compute_multitaper_psd, jnwb.cross_area_coherence |
| Cohen, M. X. (2014). Analyzing Neural Time Series Data: Theory and Practice. The MIT Press. ISBN 9780262019873. | Morlet wavelet convolution for time-frequency power and phase | jnwb.morlet_wavelet, jnwb.complex_tfr |
| Nunez, P. L., & Srinivasan, R. (2005). Electric Fields of the Brain: The Neurophysics of EEG. Oxford University Press, USA. ISBN 9780195050387. | Current source density across electrode contacts, from the second spatial difference of the potential | jnwb.current_source_density_1d, jnwb.laplacian_reference |
| Grün, S., & Rotter, S. (2010). Analysis of Parallel Spike Trains. Springer London, Limited. ISBN 9781441956750. | Spike-count correlation and the Fano factor of parallel spike trains | jnwb.spike_count_correlation, jnwb.fano_factor |
| Efron, B., & Tibshirani, R. J. (1993). An introduction to the bootstrap. Chapman & Hall. ISBN 9780412042317. | The percentile interval of the bootstrap | jnwb.StatisticalAnalysis.bootstrap_ci |
| Good, P. I. (2004). Permutation, Parametric, and Bootstrap Tests of Hypotheses. Springer. ISBN 9780387202792. | Permutation tests: exhaustive sign flips and Monte Carlo p-values | jnwb.cluster_permutation_test, jnwb.exact_sign_flip, jnwb.shuffle_pvalue_paired, jnwb.shuffle_pvalue_unpaired |
| Cover, T. M., & Thomas, J. A. (2005). Elements of information theory, 2nd ed. J. Wiley. ISBN 9780471241959. | Mutual information of discrete variables, and the conditional form behind transfer entropy | jnwb.spike_mutual_information, jnwb.transfer_entropy |
| Hastie, T., Tibshirani, R., & Friedman, J. (2009). The Elements of Statistical Learning: Data Mining, Inference, and Prediction. Springer-Verlag New York. ISBN 9780387848570. | Cross-validation for model selection, nested around the linear support vector classifier | jnwb.nested_cv_linear_svm |
| Fisher, N. I. (1993). Statistical analysis of circular data. Cambridge University Press. ISBN 9780521350181. | The mean resultant length and the Rayleigh test of circular data | jnwb.phase_locking_index |
| Mardia, K. V., & Jupp, P. E. (2000). Directional statistics. J. Wiley. ISBN 9780471953333. | The mean resultant length of circular data | jnwb.phase_locking_index |
Studies jnwb reproduces¶
A study is listed only with the test or evidence file that checks it; each row names the quantity checked and what is left out.
| Reference | Result reproduced | Receipt |
|---|---|---|
| Fleiss, J. L. (1971). Measuring nominal scale agreement among many raters. Psychological Bulletin 76(5), 378-382. doi:10.1037/h0031619 | Partially replicated. Overall kappa, .430 for 30 patients rated by six raters into five categories. The table is transcribed in the test from the R packages irr and lagree, not read from the paper; only the overall kappa is checked, to three decimals | test_spiking.py::TestFleissKappa::test_reproduces_the_worked_example_of_fleiss_1971, runs in CI |
| Hill, D. N., Mehta, S. B., & Kleinfeld, D. (2011). Quality metrics to accompany spike sorting of extracellular signals. Journal of Neuroscience 31(24), 8699-8705. doi:10.1523/JNEUROSCI.0971-11.2011 | Replicated. The worked example: \(N/T\) = 10 Hz, \(\tau_R\) = 3 ms, \(\tau_C\) = 1 ms and \(T\) = 1000 s with 20 violations give \(f\) = 0.05, and the estimate equals the smaller root of the closed form at relative 1e-12. The paper gives no recording; the test builds the spike train that yields the violations | test_unit_quality.py::test_refractory_contamination_reproduces_the_worked_example_of_the_source, runs in CI |
| Major, A. J., et al. (2025). A. J. Major et al. reply. Nature Neuroscience 29(2), 284-286. doi:10.1038/s41593-025-02168-x. Code: Mendoza-Halliday, D., et al. (2023). vFLIP2.m, version 8 (2025-11-04). Dryad dataset. doi:10.5061/dryad.9w0vt4bnp | Replicated. The outputs of the published code vFLIP2.m (omega, goodness, bands and channels) for the three synthetic cases and the power example that have a window, and the empty result for the five cases without one, at relative 1e-9; the PSD and result from raw, trial-cut and cell LFP at the same tolerance. The check is the code's output, not a figure in the paper | test_vflip2.py::test_every_window_matches_matlab, test_vflip2.py::test_below_the_cut_the_best_window_is_returned_and_refused, test_vflip2.py::test_no_window_returns_an_empty_result and test_vflip2_from_lfp.py::test_psd_and_result_match_vflip2_m, runs in CI; test_vflip2_from_lfp.py::test_dryad_test_data_match_vflip2_m, local (skipped in CI unless the Dryad data and reference are on disk) |
| Siegle, J. H., et al. (2021). Survey of spiking in the mouse visual system reveals functional hierarchy. Nature 592(7852), 86-92. doi:10.1038/s41586-020-03171-x. Jia, X., et al. (2019). High-density extracellular probes reveal dendritic backpropagation and facilitate neuron classification. Journal of Neurophysiology 121(5), 1831-1847. doi:10.1152/jn.00680.2018 | Partially replicated. The waveform half-width, repolarization slope and spread (Jia et al.), and the amplitude cutoff, on fixed cases, as AllenInstitute ecephys_spike_sorting at commit 919992748a53 computes them. The check is that code's output, not a figure in either paper; the duration, SNR and presence ratio of Siegle et al. are not checked |
test_unit_quality.py::test_the_waveform_measures_reproduce_the_source_on_a_fixed_unit and test_unit_quality.py::test_the_amplitude_cutoff_reproduces_the_source_on_fixed_amplitudes, runs in CI |
Pitfalls¶
| Reference | Pitfall stated | Functions it concerns |
|---|---|---|
| Bastos, A. M., & Schoffelen, J.-M. (2016). A tutorial review of functional connectivity analysis methods and their interpretational pitfalls. Frontiers in Systems Neuroscience 9, 175. doi:10.3389/fnsys.2015.00175 | Five problems, one section each. A common reference adds zero-lag coherence between channels that share it; bipolar derivation largely resolves it, under the review's stated assumptions. Field spread makes coherence spurious at zero lag; re-referencing, contrasts between conditions and metrics that discard zero-lag interaction reduce it, and each can still mislead. A difference in signal-to-noise ratio between channels creates a Granger asymmetry with no true direction. Common input from an unrecorded source couples two signals; partial coherence and multivariate Granger causality need that source recorded. Coherence, PLV and Granger causality are biased upward by few observations; PPC is not | bipolar_reference, cross_area_coherence, imaginary_coherency, wpli, phase_slope_index, pairwise_phase_consistency, granger, granger_spectral |
| Vezoli, J., et al. (2021). Brain rhythms define distinct interaction networks with differential dependence on anatomy. Neuron 109(23), 3862-3878.e5. doi:10.1016/j.neuron.2021.09.052 | STAR Methods, "Quantification and statistical analysis": coherence, power correlation and Granger causality count as significant only above a bias level estimated by randomly pairing epochs, taking the maximum over site pairs. Results, "Different rhythms define distinct FC networks": sites within 2 mm of each other are left out of a site's coherence strength, to avoid residual volume conduction. cross_area_coherence builds its null by circular shifts instead, and the paper's Granger causality is nonparametric, which jnwb does not implement |
cross_area_coherence, granger_spectral |
| Friston, K. J., et al. (2014). Granger causality revisited. NeuroImage 101, 796-808. doi:10.1016/j.neuroimage.2014.06.062 | "The effects of dynamical instability and measurement noise": near instability, slowly decaying modes make a finite-order VAR fail and the autoregressive Granger measures, which granger and granger_spectral compute, unreliable, while nonparametric measures from spectral factors stay robust; measurement noise makes both the parametric and the nonparametric estimate fail, weakening the forward influence and creating a backward one |
granger, granger_spectral |
| Barnett, L., & Seth, A. K. (2011). Behaviour of Granger causality under filtering: theoretical invariance and practical application. Journal of Neuroscience Methods 201(2), 404-419. doi:10.1016/j.jneumeth.2011.08.010 | From the abstract: Granger causality of a stationary VAR process is invariant under any invertible filter, so filtering cannot isolate a band's Granger causality, and in practice filtering often changes the estimate by raising the fitted model order. The alternative is spectral Granger causality integrated over the band; granger_spectral reports the band mean |
bandpass_filter, granger_spectral |
| Nejat, H., & Hajipour Sardouie, S. (2021). Analysis of EEG based functional connectivity during mental arithmetic task. 2021 28th National and 6th International Iranian Conference on Biomedical Engineering (ICBME), 118-124. doi:10.1109/ICBME54433.2021.9750349 | From the abstract: EEG functional-connectivity graphs built from spectral coherence, mutual information and Granger causality separate subjects by the quality of their mental arithmetic. From the authors' code (mne-ext-ment-arth, README): nearby electrodes are more coherent, so a coherence graph is dense among neighboring electrodes and weak between distant sites; the edge weights are normalized by how power changes with distance before groups are compared edge by edge | cross_area_coherence, network_topology |
Data format¶
- Teeters, J. L., et al. (2015). Neurodata Without Borders: creating a common data format for neurophysiology. Neuron. doi:10.1016/j.neuron.2015.10.025
- Software: NWB overview, PyNWB, HDMF, DANDI Archive.
| Reference | Result implemented | Functions |
|---|---|---|
| Rübel, O., Tritt, A., Ly, R., Dichter, B. K., Ghosh, S., Niu, L., Baker, P., Soltesz, I., Ng, L., Svoboda, K., Frank, L., & Bouchard, K. E. (2022). The Neurodata Without Borders ecosystem for neurophysiological data science. eLife 11, e78362. doi:10.7554/eLife.78362 | The NWB format schema check and the structure checks verify_nwb describes in its docstring; the format write_nwb writes |
repair_nwb, transform_nwb, verify_nwb, write_nwb |