nSTAT Python Paper Examples
This page mirrors the MATLAB paper-example index for the standalone Python port.
Canonical source files:
examples/paper/*.pynstat/paper_examples_full.py
Run Everything
python tools/paper_examples/build_gallery.py
Outputs:
Figure metadata:
docs/figures/manifest.jsonGallery page:
docs/paper_examples.mdFigures:
docs/figures/example01/…docs/figures/example05/
Example Index
ID |
Thumbnail |
Standalone source |
Question |
Run command |
Figure gallery |
|---|---|---|---|---|---|
|
|
Do mEPSCs follow constant vs piecewise Poisson firing under Mg2+ washout? |
|
||
|
|
How do explicit whisker stimulus and spike history improve thalamic GLM fits? |
|
||
|
|
How do PSTH and SSGLM capture within-trial and across-trial dynamics? |
|
||
|
|
Which receptive-field basis (Gaussian vs Zernike) better fits place cells? |
|
||
|
|
How well do adaptive/hybrid point-process filters decode stimulus and reach state? |
|
||
|
|
How does a tensor-product B-spline Poisson GLM recover a known 2-D place field, and how do its rate and second-order diagnostics compare to an LGCP? |
|
||
|
|
Can the Bartlett spectrum and wave-peak detector recover the speed and direction of a known planar wave embedded in a multivariate Hawkes triggering matrix? |
|
||
|
|
Does a B-spline Poisson GLM trained on real hippocampal place cells produce a held-out spatial pair-correlation inside the inhomogeneous global-rank envelope, and a population rescaled-time ACF inside the Bartlett band? |
|
Gallery
Example 01: mEPSC Poisson Models Under Constant and Washout Magnesium
Question: Do mEPSCs follow constant vs piecewise Poisson firing under Mg2+ washout?
Run command: python examples/paper/example01_mepsc_poisson.py

Expected figure files:
docs/figures/example01/fig01_constant_mg_summary.pngdocs/figures/example01/fig02_washout_raster_overview.pngdocs/figures/example01/fig03_piecewise_baseline_comparison.png
Example 02: Whisker Stimulus GLM With Lag and History Selection
Question: How do explicit whisker stimulus and spike history improve thalamic GLM fits?
Run command: python examples/paper/example02_whisker_stimulus_thalamus.py

Expected figure files:
docs/figures/example02/fig01_data_overview.pngdocs/figures/example02/fig02_lag_and_model_comparison.png
Example 03: PSTH and SSGLM Dynamics Example
Question: How do PSTH and SSGLM capture within-trial and across-trial dynamics?
Run command: python examples/paper/example03_psth_and_ssglm.py

Expected figure files:
docs/figures/example03/fig01_simulated_and_real_rasters.pngdocs/figures/example03/fig02_psth_comparison.pngdocs/figures/example03/fig03_ssglm_simulation_summary.pngdocs/figures/example03/fig04_ssglm_fit_diagnostics.pngdocs/figures/example03/fig05_stimulus_effect_surfaces.pngdocs/figures/example03/fig06_learning_trial_comparison.png
Example 04: Place-Cell Receptive Fields (Gaussian vs Zernike)
Question: Which receptive-field basis (Gaussian vs Zernike) better fits place cells?
Run command: python examples/paper/example04_place_cells_continuous_stimulus.py

Expected figure files:
docs/figures/example04/fig01_example_cells_path_overlay.pngdocs/figures/example04/fig02_model_summary_statistics.pngdocs/figures/example04/fig03_gaussian_place_fields_animal1.pngdocs/figures/example04/fig04_zernike_place_fields_animal1.pngdocs/figures/example04/fig05_gaussian_place_fields_animal2.pngdocs/figures/example04/fig06_zernike_place_fields_animal2.pngdocs/figures/example04/fig07_example_cell_mesh_comparison.png
Example 05: Stimulus Decoding With PPAF and PPHF
Question: How well do adaptive/hybrid point-process filters decode stimulus and reach state?
Run command: python examples/paper/example05_decoding_ppaf_pphf.py

Expected figure files:
docs/figures/example05/fig01_univariate_setup.pngdocs/figures/example05/fig02_univariate_decoding.pngdocs/figures/example05/fig03_reach_and_population_setup.pngdocs/figures/example05/fig04_ppaf_goal_vs_free.pngdocs/figures/example05/fig05_hybrid_setup.pngdocs/figures/example05/fig06_hybrid_decoding_summary.png
Example 06: 2-D Place-Field Recovery With a B-Spline GLM Basis and an LGCP Comparator
Question: How does a tensor-product B-spline Poisson GLM recover a known 2-D place field, and how do its rate and second-order diagnostics compare to an LGCP?
Run command: python examples/paper/example06_place_fields_glm_basis.py

Expected figure files:
docs/figures/example06/fig01_true_vs_basis_recovered_rate.pngdocs/figures/example06/fig02_lgcp_glm_credible_band.pngdocs/figures/example06/fig03_pcf_with_global_envelope.png
Example 07: Spatiotemporal Wave Analysis of a Synthetic Planar-Wave Hawkes Adjacency
Question: Can the Bartlett spectrum and wave-peak detector recover the speed and direction of a known planar wave embedded in a multivariate Hawkes triggering matrix?
Run command: python examples/paper/example07_spatiotemporal_hawkes_waves.py

Expected figure files:
docs/figures/example07/fig01_adjacency_and_positions.pngdocs/figures/example07/fig02_bartlett_spectrum.pngdocs/figures/example07/fig03_detected_peaks_overlay.png
Example 08: Real Place-Cell Encoding-and-Decoding With Held-Out Spatial GoF
Question: Does a B-spline Poisson GLM trained on real hippocampal place cells produce a held-out spatial pair-correlation inside the inhomogeneous global-rank envelope, and a population rescaled-time ACF inside the Bartlett band?
Run command: python examples/paper/example08_real_place_cells.py

Expected figure files:
docs/figures/example08/fig01_real_place_fields_panel.pngdocs/figures/example08/fig02_decoded_vs_true_position.pngdocs/figures/example08/fig03_pair_correlation_envelope.pngdocs/figures/example08/fig04_rescaled_acf.pngdocs/figures/example08/fig05_velocity_speed_tuning.pngdocs/figures/example08/fig06_decoder_baseline_vs_velocity.pngdocs/figures/example08/fig07_history_kernels.pngdocs/figures/example08/fig08_decoder_baseline_vs_history.pngdocs/figures/example08/fig09_coupling_matrix.pngdocs/figures/example08/fig10_decoder_baseline_vs_progression.pngdocs/figures/example08/fig11_per_cell_lag_ccf.pngdocs/figures/example08/fig12_lag_corrected_comparison.png