Fix CIFModel.from_linear_terms to use Poisson log link#65
Merged
iahncajigas merged 5 commits intomainfrom Mar 16, 2026
Merged
Conversation
…istic The method incorrectly applied exp(eta)/(1+exp(eta)) (logistic/binomial link) instead of exp(eta) (Poisson log link), producing fire rates bounded to ~1 regardless of the actual linear predictor. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- nstat/fit.py: clip Z before exp(-Z) to prevent -inf in uniforms; filter non-finite values in plotSeqCorr correlation computation - example03: replace 3D plot_surface with pcolormesh to match MATLAB top-down mesh view for stimulus effect surfaces - example04/05: fix tick_labels → labels for matplotlib <3.9 compat - Add regenerate_all_figures.py script and CI job to rebuild all paper figures on every push Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ing MATLAB - Accept fit_num=None to overlay all fits (like plotSeqCorr/KSPlot) - Plot ACF as scatter dots with per-fit colors instead of single-color bars - Remove max_lag=25 truncation to show full ACF range matching MATLAB xcov - Add legend with fit labels; CI lines drawn without legend entries - Update plotResults to call plotInvGausTrans(fit_num=None) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Example 01 Figs 1 & 3: Replace plotResults() 2x4 grid with custom 2x2 layout matching MATLAB (raster, ACF, KS plot, lambda estimate) - plotCoeffs: Support multi-fit overlay (default fit_num=None plots all fits) - plotResidual: Support multi-fit overlay with per-fit colors and legend, symmetric y-axis, title changed to "Point Process Residual" - plotSeqCorr: Title changed to "Sequential Correlation of Rescaled ISIs" - plotResults: Pass fit_num=None to plotCoeffs and plotResidual Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When comparing models with different numbers of coefficients, plotCoeffs used xpos from only the first fit's labels. Now builds a unified x-axis from all fits' labels and maps each fit's coeffs to the correct positions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CIFModel.from_linear_terms()incorrectly applied logistic linkexp(η)/(1+exp(η))instead of Poisson log linkexp(η)Test plan
pytest -qpasses (12/12, 2 skipped)🤖 Generated with Claude Code