Skip to content

lindermanlab/NeymanScottProcesses.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NeymanScottProcesses.jl

Neyman-Scott processes in Julia.

Yixin Wang, Anthony Degleris, Alex Williams, Scott Linderman.
Spatiotemporal Clustering with Neyman-Scott Processes via Connections to Bayesian Nonparametric Mixture Models.

Installation

First, download and install Julia. Then run julia from the terminal to open the Julia REPL. From the REPL, type ] to enter package mode and run

pkg> add https://github.com/lindermanlab/NeymanScottProcesses.jl

to install this package. If you want to plotting capabilities, you'll also need to run

pkg> add Plots

to install Plots. Finally, press backspace / delete to exit package mode.

Neural Spike Modeling

If you're interested in using Neyman-Scott processes for modeling neural spike trains, please check out PPSeq.jl.

JASA Reproducibility

If you are interested in reporoducing our results from our JASA paper, please read the sections below to reproduce individual experiments and figures.

Installation and Setup

Reproducing experimental results will require cloning the repository directly and activating the Julia environments used to generate each figure. To download the respository, first install Julia and downlod the respository:

git clone https://github.com/lindermanlab/NeymanScottProcesses.jl.git

Next, from the NeymanScottProcesses directory, run:

julia setup.jl

This will download and install all the project dependencies specified in Project.toml, as well as experiment specific dependencies.

Interactive Experiments

Some experiments were developed using Pluto notebooks. All Pluto notebooks use plain .jl files and can be run as normal Julia scripts. However, if you'd like to run them interactively, we recommend you install pluto using the Julia package manager (type ] from the REPL)

pkg> add Pluto

Running a Pluto notebook server is than as simple as running:

julia> using Pluto
julia> Pluto.run()

All the notebooks will automatically activate the relevant environments installed in the previos section.

Figure 2 - Synthetic draws from NSPs and DPMMs

To reproduce Figure 2, run the following script (or open it in a Pluto notebook):

julia experiments/dpm_limit/example_data.jl

Figure 3 - Sampler performance

To reproduce Figure 3, run the following script (or open it in a Pluto notebook):

julia experiments/dpm_limit/cj_vs_rj.jl

Figure 4 - NSP and DPMM modeling performance

To reproduce Figure 4, run the following script (or open it in a Pluto notebook):

julia experiments/dpm_limit/nsp_vs_dpm.jl

Figure 5 - Neural modeling

The code used to generate Figure 5 comes from an older repository that specifically considers Neyman-Scott processes for modeling neural spike trains. All of this code is available in the ppseq/ directory. Specifically, source code is in ppseq/PointProcessSequences/ and experiment scripts are in ppseq/ppseq/. For each panel in Figure 6, the data is generated by running a script of the form:

julia ppseq/ppseq/launch_<experiment_name>.jl

After generating the results, figures can be reproduced using the code in ppseq/ppseq/figures/.

Figure 6 - Document modeling

To reproduce Figure 6, you'll need acquire the embassy document stream dataset from the authors and place it in experiments/embassy/raw/raw. Once you've acquired the data, you can run the following scripts to generate the results:

julia experiments/embassy/run_baseline.jl
julia experiments/embassy/run_nsp.jl

These may take some time. You can then plot the results by running the following script (or opening it in Pluto):

julia experiments/embassy/make_plots.jl