ppdiag

ppdiag: Diagnostic Tools for Temporal Point Processes - Published in JOSS (2021)

https://github.com/owenward/ppdiag

Science Score: 95.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 8 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org
  • Committers with academic emails
    1 of 3 committers (33.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Scientific Fields

Engineering Computer Science - 40% confidence
Last synced: 6 months ago · JSON representation

Repository

Basic Info
Statistics
  • Stars: 5
  • Watchers: 1
  • Forks: 2
  • Open Issues: 2
  • Releases: 2
Created over 5 years ago · Last pushed about 3 years ago
Metadata Files
Readme Changelog Contributing License Code of conduct

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "75%"
)
```

# ppdiag


[![R build status](https://github.com/OwenWard/ppdiag/workflows/R-CMD-check/badge.svg)](https://github.com/OwenWard/ppdiag/actions)
[![CRAN status](https://www.r-pkg.org/badges/version/ppdiag)](https://CRAN.R-project.org/package=ppdiag)
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)
[![Codecov test coverage](https://codecov.io/gh/OwenWard/ppdiag/branch/main/graph/badge.svg)](https://codecov.io/gh/OwenWard/ppdiag?branch=main)
[![DOI](https://joss.theoj.org/papers/10.21105/joss.03133/status.svg)](https://doi.org/10.21105/joss.03133)



``ppdiag`` is an `R` package which provides a collection of tools which
can be used to assess the fit of temporal point processes to data.

These currently include:

- Simulating data from a specified point process
- Fitting a specified point process model to data
- Evaluating the fit of a point process model to data using 
several diagnostic tools

# Installation

You can install the released version of ppdiag from [CRAN](https://CRAN.R-project.org) with:

```{r, eval=FALSE}
install.packages("ppdiag")
```

The current development version of this
package is available from [GitHub](https://github.com/OwenWard/ppdiag) with:

```{r, eval=FALSE}
# install.packages("remotes")
remotes::install_github("OwenWard/ppdiag")
```
# Example

To illustrate some of the basic functionality of this package,
we can simulate data from a specified Hawkes process and examine
our diagnostic results when we fit a homogeneous Poisson process
to this data.

```{r example}
library(ppdiag)

hp_obj <- pp_hp(lambda0 = 0.2, alpha = 0.35, beta = 0.8)
sim_hp <- pp_simulate(hp_obj, end = 200)
sim_hp

```
We can readily evaluate the fit of a homogeneous Poisson process to this
data.

```{r fit_hpp}
est_hpp <- fithpp(sim_hp)
est_hpp

pp_diag(est_hpp, events = sim_hp)
```


```{r fit_hp}
hp_est <- fithp(events = sim_hp)
pp_diag(hp_est, events = sim_hp)

```


## Markov Modulated Hawkes Process Example

This is particularly useful for more complex point processes, such as the 
Markov Modulated Hawkes Process (MMHP).
We can simulate events from this model
and examine the fit of simpler point processes to this data.

```{r mmhp example}
Q <- matrix(c(-0.2, 0.2, 0.1, -0.1), ncol = 2, byrow = TRUE)

mmhp_obj <- pp_mmhp(Q, delta = c(1 / 3, 2 / 3), 
          lambda0 = 0.2,
          lambda1 = .75,
          alpha = 0.4,
          beta = 0.8)

mmhp_obj
mmhp_events <- pp_simulate(mmhp_obj, n = 50)
```

We can easily fit a homogeneous Poisson process and visualise the goodness of 
fit.

```{r fit_hpp_to_mmhp}
est_hpp <- fithpp(events = mmhp_events$events)
pp_diag(est_hpp,mmhp_events$events)
```

Similarly for a Hawkes process.

```{r fit_hp_to_mmhp}
est_hp <- fithp(events = mmhp_events$events)
pp_diag(est_hp,mmhp_events$events)
```

We can then compare to the true point process model.

```{r fit_mmhp}
pp_diag(mmhp_obj, mmhp_events$events)
```


# Getting help and contributing

Please file any issues [here](https://github.com/OwenWard/ppdiag/issues). 
Similarly, we would be delighted if anyone would like to contribute to
this package (such as adding other point processes, kernel functions). 
Feel free to take a look
[here](https://github.com/OwenWard/ppdiag/blob/main/CONTRIBUTING.md)
and reach out with any questions.

# References

- Sun et al., (2021). ppdiag: Diagnostic Tools for Temporal Point Processes. Journal of Open Source Software, 6(61), 3133, https://doi.org/10.21105/joss.03133
- Wu et al. (2021), Diagnostics and Visualization of Point Process Models for Event Times on a Social Network, 
In Applied Modeling Techniques and Data Analysis 1 (eds Y. Dimotikalis, A. Karagrigoriou, C. Parpoula and C.H. Skiadas).
https://doi.org/10.1002/9781119821588.ch7

Owner

  • Name: Owen Ward
  • Login: OwenWard
  • Kind: user
  • Location: Vancouver/Dublin

Assistant Professor, Statistics and Actuarial Science, Simon Fraser University

JOSS Publication

ppdiag: Diagnostic Tools for Temporal Point Processes
Published
May 27, 2021
Volume 6, Issue 61, Page 3133
Authors
Sally Sun
Department of Statistics, Columbia University
Owen G. Ward ORCID
Department of Statistics, Columbia University
Jing Wu
Department of Statistics, Columbia University
Lihao Xiao
Department of Statistics, Columbia University
Xiaoxi Zhao
Department of Statistics, Columbia University
Tian Zheng
Department of Statistics, Columbia University, Data Science Institute, Columbia University
Editor
Mikkel Meyer Andersen ORCID
Tags
Diagnostics Goodness of fit Temporal Point Processes

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 479
  • Total Committers: 3
  • Avg Commits per committer: 159.667
  • Development Distribution Score (DDS): 0.478
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
sallyqiansun 4****n 250
Owen Ward 3****d 203
Xiaoxi Zhao x****0@c****u 26
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 21
  • Total pull requests: 42
  • Average time to close issues: 23 days
  • Average time to close pull requests: 9 days
  • Total issue authors: 3
  • Total pull request authors: 4
  • Average comments per issue: 0.81
  • Average comments per pull request: 1.76
  • Merged pull requests: 36
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • OwenWard (18)
  • mikldk (2)
  • wjakethompson (1)
Pull Request Authors
  • OwenWard (22)
  • sallyqiansun (18)
  • arfon (1)
  • wjakethompson (1)
Top Labels
Issue Labels
small fix (7) enhancement (3) large fix (2) bug (1) documentation (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 193 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 1
cran.r-project.org: ppdiag

Diagnosis and Visualizations Tools for Temporal Point Processes

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 193 Last month
Rankings
Forks count: 17.8%
Stargazers count: 26.2%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Average: 38.4%
Downloads: 82.8%
Maintainers (1)
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.5 depends
  • graphics * imports
  • stats * imports
  • covr * suggests
  • knitr * suggests
  • rmarkdown * suggests
  • testthat >= 2.1.0 suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/upload-artifact main composite
  • r-lib/actions/setup-pandoc master composite
  • r-lib/actions/setup-r master composite
.github/workflows/check-standard.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
.github/workflows/test-coverage.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite