About PHPstats

PHPstats is a set of open-source PHP packages for data analysis: data frames, data transformation, statistical models, Bayesian inference, charts, and notebooks. Each package can be installed and used on its own. They are designed to work well together.

PHPstats was created by Erik Westlund.

Packages

Package Purpose
phibble Immutable, typed data frames for PHP.
phplyr dplyr, tidyr, and janitor data wrangling in PHP.
phpolars Polars data frames for PHP through a native extension.
juphyter A Jupyter and Quarto kernel for PHP.
phit Statistical models, probability distributions, and descriptive statistics.
phiz ggplot2-style charts rendered with Vega-Lite.
CmdStanPHP Bayesian modeling with Stan from PHP, through CmdStan.

Design

PHPstats is heavily influenced by the tidyverse and the tidy approach to statistical computing in R. It also draws on ideas and software from the Python community, including Polars and Jupyter, as well as from the Stan ecosystem.

Validation

The packages include comparisons against established R and Python libraries. Each package documents its checks:

AI statement

PHPstats was developed with AI assistance. Large language models wrote and revised much of the code and documentation. Rebuilding the methods of established R, Python, and Stan packages in PHP by hand would not be practical for one person.

Credit for those methods belongs to the authors of the original packages, which each package's documentation names and links. Each package's results are compared against those packages, and the Verification section of each package publishes the comparisons. If you find an error, please open an issue in the package's repository in the PHPstats organization on GitHub.

Source and license

The source of every package and of this site is in the PHPstats organization on GitHub. The site and every package except CmdStanPHP are released under the MIT license. CmdStanPHP is released under the GNU General Public License, version 3 or later, because parts of it follow GPL-licensed R packages. Each repository's THIRD_PARTY_NOTICES.md lists the code that follows other projects, with their licenses.