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.187381

Stats Can Be Merged

julia> y2 = randn(100);


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


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

Stats Have a Value

julia> value(m)
-0.0022138708637833293