{"id":17113018,"url":"https://github.com/emmt/multivariateonlinestatistics.jl","last_synced_at":"2025-08-13T01:11:58.589Z","repository":{"id":71510251,"uuid":"366149089","full_name":"emmt/MultivariateOnlineStatistics.jl","owner":"emmt","description":"A Julia package for estimating statistics of multi-variate samples, as the data is obtained.","archived":false,"fork":false,"pushed_at":"2024-05-02T16:49:36.000Z","size":48,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T22:34:37.980Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emmt.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-10T19:06:27.000Z","updated_at":"2024-05-02T16:49:39.000Z","dependencies_parsed_at":"2024-05-02T17:49:42.936Z","dependency_job_id":"1605b7ff-bbd2-478c-863b-2d6a67c5a51f","html_url":"https://github.com/emmt/MultivariateOnlineStatistics.jl","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FMultivariateOnlineStatistics.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FMultivariateOnlineStatistics.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FMultivariateOnlineStatistics.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FMultivariateOnlineStatistics.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emmt","download_url":"https://codeload.github.com/emmt/MultivariateOnlineStatistics.jl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248107873,"owners_count":21049025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T17:02:19.237Z","updated_at":"2025-04-09T20:33:47.031Z","avatar_url":"https://github.com/emmt.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multi-variate online statistics\n\n[![Documentation][doc-dev-img]][doc-dev-url]\n[![License][license-img]][license-url]\n[![Build Status][github-ci-img]][github-ci-url]\n[![Build Status][appveyor-img]][appveyor-url]\n[![Coverage][coveralls-img]][coveralls-url]\n\n`MultivariateOnlineStatistics` is a [Julia](http://julialang.org/) package to\nestimate statistical moments of multi-variate data.  Computation are performed\n*on-line* that is in one pass, as the data is obtained.\n\n\n## Documentation\n\n### Construction\n\nTo create an object `A` to collect the `L` first statistical moments of\nindependent `N`-dimensional data of dimensions `dims`, call:\n\n```julia\nA = IndependentStatistics{L,T,N}(dims)\n```\n\nType parameter `T` is the floating-point type for computed statistcs.  The\nnumber `N` of dimensions may be omitted as it must be equal to `length(dims)`:\n\n```julia\nA = IndependentStatistics{L,T}(dims)\n```\n\nFor fine tuning the type of storage used by the object, the arrays `s1`, `s2`,\n..., and `sL` storing the statistics may be provided as an `L`-tuple:\n\n```julia\nA = IndependentStatistics((s1, s2, ..., sL))\n```\n\nwhere `s1`, `s2`, ..., and `sL` are arrays having the same floating-point\nelement type and the same indices.  The storage arrays will be zero-filled.\n\nIf storage arrays already contain statistical moments collected from a number\nof independent samples, then call the constructor with the number `n` of\nsamples specified as the last argument:\n\n```julia\nA = IndependentStatistics((s1, s2, ..., sL), n)\n```\n\nIn that case, input arrays `s1`, `s2`, ..., and `sL` must have been correctly\nintialized, typically as follows (∀i):\n\n ```julia\ns1[i] = (x_1[i] + ... + x_n[i])/n\ns2[i] = (x_1[i] - s1[i])^2 + ... + (x_n[i] - s1[i])^2\n...\nsL[i] = (x_1[i] - s1[i])^L + ... + (x_n[i] - s1[i])^L\n```\n\nwith `x_j` the `j`-th data sample and where index `i` may be multi-dimensional.\nThat is to say that `s1` is the element-wise empirical mean of the samples\nwhile `s2`, ..., and `sL` are the sum over the samples of the element-wise\nsample difference with their element-wise empirical mean raised to the\ncorresponding power.\n\n\n### Uaage\n\nAssuming `A` is an instance of `IndependentStatistics`, then collecting\nstatistics from more samples is done by:\n\n```julia\npush!(A, x...) -\u003e A\nmerge!(A, itr) -\u003e A\n```\n\nwhere each `x...` is a single data sample, an (abstract) array of suitable\ndimension, while `itr` is an iterable object which yields independent data\nsamples.  The recurrence formula of Welford (1962) is used to avoid loss of\nprecision due to rounding errors.\n\n:warning: It is assumed that data samples are mutually independent.\n\nIf `B` is another instance of `IndependentStatistics`, the statistics collected\nby `B` can be merged into `A` by:\n\n```julia\nmerge!(A, B) -\u003e A\n```\n\nIn this case, the recurrence formula of Chan, Golub and LeVeque (1979) is used\nto avoid loss of precision due to rounding errors.\n\nTo retrieve statistics, a number of methods from the `Statistics` and\n`StatsBase` package are re-exported:\n\n```julia\nnobs(A)                # the number of independent samples\nmean(A)                # the element-wise sample mean\nvar(A; corrected=true) # the element-wise sample variance\nstd(A; corrected=true) # the element-wise sample standard deviation\n```\n\nIf keyword `corrected` is true (the default) then an unbiased estimator is\nreturned; otherwise, the maximum-likelihood estimator is returned.\n\nIt is also possible to retrieve the statistical moments for a given data index:\n\n```julia\nmean(A, I...)                # sample mean at indices I...\nvar(A, I...; corrected=true) # sample variance at indices I...\nstd(A, I...; corrected=true) # sample standard deviation at indices I...\n```\n\nThe following basic methods are also applicable to an instance of\n`IndependentStatistics`:\n\n```julia\nndims(A)   # the number of dimensions of a data sample\nsize(A)    # the dimensions of a data sample\nsize(A, k) # the k-th dimension of a data sample\naxes(A)    # the axes of a data sample\naxes(A, k) # the k-th axis of a data sample\neltype(A)  # the floating-point type of the collected statistics\norder(A)   # the maximum order of statistical moments\n```\n\n\n## Installation\n\nThe easiest way to install `MultivariateOnlineStatistics` is via Julia registry\n[`EmmtRegistry`](https://github.com/emmt/EmmtRegistry):\n\n```julia\nusing Pkg\npkg\"registry add https://github.com/emmt/EmmtRegistry\"\npkg\"add MultivariateOnlineStatistics\"\n```\n\n\n[doc-stable-img]: https://img.shields.io/badge/docs-stable-blue.svg\n[doc-stable-url]: https://emmt.github.io/MultivariateOnlineStatistics.jl/stable\n\n[doc-dev-img]: https://img.shields.io/badge/docs-dev-blue.svg\n[doc-dev-url]: https://emmt.github.io/MultivariateOnlineStatistics.jl/dev\n\n[license-url]: ./LICENSE.md\n[license-img]: http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat\n\n[github-ci-img]: https://github.com/emmt/MultivariateOnlineStatistics.jl/actions/workflows/CI.yml/badge.svg?branch=master\n[github-ci-url]: https://github.com/emmt/MultivariateOnlineStatistics.jl/actions/workflows/CI.yml?query=branch%3Amaster\n\n[appveyor-img]: https://ci.appveyor.com/api/projects/status/github/emmt/MultivariateOnlineStatistics.jl?branch=master\n[appveyor-url]: https://ci.appveyor.com/project/emmt/MultivariateOnlineStatistics-jl/branch/master\n\n[coveralls-img]: https://coveralls.io/repos/emmt/MultivariateOnlineStatistics.jl/badge.svg?branch=master\u0026service=github\n[coveralls-url]: https://coveralls.io/github/emmt/MultivariateOnlineStatistics.jl?branch=master\n\n[codecov-img]: http://codecov.io/github/emmt/MultivariateOnlineStatistics.jl/coverage.svg?branch=master\n[codecov-url]: http://codecov.io/github/emmt/MultivariateOnlineStatistics.jl?branch=master\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmt%2Fmultivariateonlinestatistics.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femmt%2Fmultivariateonlinestatistics.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmt%2Fmultivariateonlinestatistics.jl/lists"}