Basics

Basics

OnlineStats is a Julia package for statistical analysis with algorithms that run both online and in parallel. Online algorithms are well suited for streaming data or when data is too large to hold in memory. Observations are processed one at a time and all algorithms use O(1) memory.

Installation

import Pkg
Pkg.add("OnlineStats")

Basics

Every Stat is <: OnlineStat

julia> using OnlineStats


julia> m = Mean()
Mean: n=0 | value=0.0

Stats Can Be Updated

julia> y = randn(100);


julia> fit!(m, y)
Mean: n=100 | value=0.0371766

Stats Can Be Merged

julia> y2 = randn(100);


julia> m2 = fit!(Mean(), y2)
Mean: n=100 | value=0.0640232


julia> merge!(m, m2)
Mean: n=200 | value=0.0505999

Stats Have a Value

julia> value(m)
0.050599885088037436