Skip to content

Latest commit

 

History

376 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fstats

FSTATS is a modern Fortran 2018 statistical library. The public API is collected in the fstats module, so applications can generally start with use fstats.

Status

CMake Actions Status

Capabilities

FSTATS includes the following areas of functionality:

  • Descriptive statistics: means, variance, standard deviation, medians, quantiles, trimmed means, covariance, and pooled variance.
  • Probability distributions: normal, log-normal, Student's t, F, chi-squared, binomial, Poisson, and multivariate normal distributions.
  • Hypothesis testing: confidence intervals, t-tests, F-tests, Bartlett's test, Levene's test, and sample-size calculations.
  • ANOVA: one-factor and two-factor analysis of variance.
  • Regression: polynomial linear least squares, regression statistics, R-squared metrics, correlations, numerical Jacobians, and nonlinear Levenberg-Marquardt least squares.
  • Experimental design: full and fractional factorial designs, central composite designs, Latin hypercube designs, model fitting, diagnostics, prediction, model comparison, ANOVA, efficiency, and response-surface optimization.
  • Measurement systems analysis: gauge repeatability and reproducibility (gauge R&R) studies of crossed, nested, and expanded designs, reporting variance components, percent contribution, percent study variation, percent tolerance, and the number of distinct categories.
  • Resampling and simulation: bootstrap resampling, random sampling, rejection sampling, Box-Muller sampling, and multivariate normal sampling.
  • Markov chain Monte Carlo: chains, target distributions, proposals, samplers, and model evaluation.
  • Signal and numerical methods: Allan variance, LOWESS smoothing, linear/polynomial/spline/Hermite interpolation, and missing-data imputation.
  • Special functions: beta and gamma functions, regularized and incomplete forms, and the digamma function.

Building with CMake

CMake 3.24 or newer, a Fortran 2018 compiler, Git, and OpenMP support are required. CMake looks for LINALG and COLLECTIONS; if compatible installations are not found, it fetches reference versions automatically.

Configure and build the library:

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel

Tests and examples are disabled by default. Enable either or both at configure time:

cmake -S . -B build -DBUILD_TESTING=ON -DBUILD_FSTATS_EXAMPLES=ON
cmake --build build --parallel
ctest --test-dir build --output-on-failure

Install the library, module files, CMake package files, and pkg-config metadata with:

cmake --install build --prefix ./install

FPM can also be used to build this library using the provided fpm.toml.

fpm build --profile release
fpm test --profile release

FPM resolves the linalg, collections, and OpenMP dependencies declared by this project. To use FSTATS as a dependency in another FPM project, add the following to that project's fpm.toml:

[dependencies]
fstats = { git = "https://github.com/jchristopherson/fstats", tag = "v1.7.0" }

Then import the API in Fortran with use fstats and build normally with fpm build.

Documentation

The generated API documentation is available here.

External Libraries

FSTATS uses LINALG for linear algebra and COLLECTIONS for collection types. An optimized BLAS and LAPACK installation is recommended for best performance when using LINALG.