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.
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.
If you're interested in using Neyman-Scott processes for modeling neural spike trains, please check out PPSeq.jl.
If you are interested in reporoducing our results from our JASA paper, please read the sections below to reproduce individual experiments and figures.
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.
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.
To reproduce Figure 2, run the following script (or open it in a Pluto notebook):
julia experiments/dpm_limit/example_data.jl
To reproduce Figure 3, run the following script (or open it in a Pluto notebook):
julia experiments/dpm_limit/cj_vs_rj.jl
To reproduce Figure 4, run the following script (or open it in a Pluto notebook):
julia experiments/dpm_limit/nsp_vs_dpm.jl
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/
.
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