nstat.FitResSummary
- class nstat.FitResSummary(fit_results)[source]
Bases:
FitSummaryMATLAB-compatible alias for FitSummary.
- __init__(fit_results)
Construct a population-level summary (Matlab
FitResSummary).- Parameters:
fit_results (FitResult or iterable of FitResult) – One or more per-neuron
FitResultobjects to summarise. A singleFitResultis wrapped in a list automatically.- Raises:
ValueError – If an empty iterable is passed.
- Return type:
None
Notes
On construction the summary precomputes per-config means and standard deviations of AIC, BIC, log-likelihood, KS statistics, and the union of covariate labels across all neurons. Rows (neurons) with fewer configs than the maximum are NaN-padded so every metric matrix has shape
(numNeurons, numResults).See also
FitResultPer-neuron fit container.
- binCoeffs(minVal=-12.0, maxVal=12.0, binSize=0.1)
Histogram of regression coefficients per covariate.
Matches Matlab FitResSummary.binCoeffs: for each unique covariate, bins the significant coefficient values across all neurons/fits, normalizes to a PDF, and computes the fraction of times each covariate was significant.
- Returns:
N ((nBins, nCovariates) per-covariate normalized histograms (PDFs))
edges ((nBins + 1,) bin edges)
percentSig ((nCovariates,) fraction of times each covariate was significant)
- boxPlot(X, diffIndex=1, h=None, dataLabels=None, **kwargs)
General-purpose box-plot of X columns with fit-name labels.
- Parameters:
diffIndex (int)
- static fromStructure(structure)
Reconstruct a
FitSummaryfrom a dict.- Parameters:
- Return type:
- getCoeffIndex(fitNum=None)
Return 0-based indices into uniqueCovLabels that are NOT history terms.
- getCoeffs(fitNum=0)
Return
(coeffMat, labels, seMat)aligned to unique labels.- Parameters:
fitNum (int)
- getDiffAIC(idx=1)
Return ΔAIC relative to config idx (0-based).
- getDiffBIC(idx=1)
Return ΔBIC relative to config idx (0-based).
- getDifflogLL(idx=1)
Return Δlog-likelihood relative to config idx (0-based).
- getHistCoeffs(fitNum=0)
Return
(histMat, labels, seMat)for history coefficients.- Parameters:
fitNum (int)
- getHistIndex(fitNum=None)
Return 0-based indices into uniqueCovLabels that are history terms.
- getSigCoeffs(fitNum=0)
Return (nNeurons × nCov) binary significance matrix.
- Parameters:
fitNum (int)
- mapCovLabelsToUniqueLabels()
Rebuild the union of covariate labels across all neurons.
- plot2dCoeffSummary(handle=None)
Stacked line plot of binned coefficient distributions (Matlab
plot2dCoeffSummary).
- plot3dCoeffSummary(handle=None)
3D ribbon plot of binned coefficient distributions (Matlab
plot3dCoeffSummary).
- plotAIC(handle=None)
Box-plot of AIC across neurons (Matlab
plotAIC).
- plotAllCoeffs(fitNum=None, plotSignificance=True, subIndex=None, handle=None)
Errorbar plot of GLM coefficients across neurons (Matlab
plotAllCoeffs).
- plotBIC(handle=None)
Box-plot of BIC across neurons (Matlab
plotBIC).
- plotCoeffsWithoutHistory(fitNum=None, plotSignificance=True, handle=None)
Plot coefficients excluding history terms (Matlab
plotCoeffsWithoutHistory).
- plotHistCoeffs(fitNum=None, plotSignificance=True, handle=None)
Plot only the history coefficients (Matlab
plotHistCoeffs).
- plotIC(handle=None)
Plot AIC, BIC, and log-likelihood box-plots side by side.
- plotKSSummary(neurons=None, handle=None)
Subplot grid of KS plots per neuron (Matlab
plotKSSummary).
- plotResidualSummary(handle=None)
Overlay all neurons’ martingale residuals (Matlab
plotResidualSummary).
- plotSummary(handle=None)
Bar chart of mean AIC, BIC, and log-likelihood across configs.
- plotlogLL(handle=None)
Box-plot of log-likelihood across neurons (Matlab
plotlogLL).
- setCoeffRange(minVal, maxVal)
Set the coefficient range used by
binCoeffs.