https://github.com/manifoldfr/point-process-rust
Simulation of point processes in the Rust programming language
https://github.com/manifoldfr/point-process-rust
mathematical-modelling rust rust-lang
Last synced: 2 months ago
JSON representation
Simulation of point processes in the Rust programming language
- Host: GitHub
- URL: https://github.com/manifoldfr/point-process-rust
- Owner: ManifoldFR
- License: mit
- Created: 2018-06-09T10:29:07.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-02-04T18:31:56.000Z (over 2 years ago)
- Last Synced: 2024-10-12T16:46:09.178Z (7 months ago)
- Topics: mathematical-modelling, rust, rust-lang
- Language: Rust
- Homepage:
- Size: 2.95 MB
- Stars: 40
- Watchers: 1
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Point processes in Rust
[](https://crates.io/crates/point_process)
[](https://docs.rs/point_process)
[](https://raw.githubusercontent.com/ManifoldFR/point-process-rust/master/LICENSE)
[](https://travis-ci.org/ManifoldFR/point-process-rust)Point processes are stochastic processes with a wide range of applications in seismology, epidemiology, or financial mathematics. They are utilized to model the arrival of random events as a function of time.

This crate provides functions to simulate point processes in [Rust](https://rust-lang.org), built on top of [`ndarray`](https://github.com/bluss/ndarray). There is a Rust API available through the base crate as well as a Python library crate.
## Overview
### Time-dependent processes
The following time-dependent point processes have been implemented within the `temporal` module:
* Poisson point process (homogeneous and inhomogeneous, with custom function)
* Exponential-kernel Hawkes processes, using a linear-time simulation algorithm (both constant and variable background intensities supported)
### Spatial processes

The `generalized` module provides functions for higher-dimensional processes.
For now, only Poisson processes have been implemented.
### Estimators
The [`estimators`](./lib/src/estimators) module provides estimator routines for point process statistics such as the intensity.

## Python package
An Python wrapper crate is available in the [`pylib`](./pylib) directory.
## Examples
Run the examples with for instance
```bash
cd lib/
cargo run --example variable_poisson
```Some will produce SVG image files in the [`lib/examples`](./lib/examples) directory.
The examples show how to use the API.
They require the [`plotters` crate](`https://github.com/38/plotters`) for plotting.
## Building locally
To compile the Rust library, do
```bash
cd lib/
cargo build
```To build the Python library,
```bash
cd pylib/
cargo build --release
```
**Warning** on macOS, you might need to add the following to `~/.cargo/config` (see [PyO3's README](https://github.com/PyO3/pyo3)):
```toml
[target.x86_64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]
```
or linking with the C compiler will fail.To compile both crates at the same time, just do
```
cargo build
```