Skip to content

Latest commit

 

History

History
31 lines (17 loc) · 763 Bytes

README.md

File metadata and controls

31 lines (17 loc) · 763 Bytes

WeightedStats

Build Status Coverage Status

A tiny Julia package which calculates weighted medians and means. Yep, that's it!

Usage

Installation:

julia> Pkg.add("WeightedStats")

Use:

julia> using WeightedStats

julia> data = [2, 0.6, 1.3, 0.3, 0.3, 1.7, 0.7, 1.7, 0.4];

julia> weights = [2, 2, 0, 1, 2, 2, 1, 6, 0];

julia> println(weighted_median(data, weights))
1.7

julia> println(weighted_mean(data, weights))
1.275

Boom!

Tests

$ julia test/runtests.jl