Last active
November 12, 2015 22:48
-
-
Save cdrnet/d2b6982cada272801df4 to your computer and use it in GitHub Desktop.
Merging RunningStatistics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a = new RunningStatistics(Normal.Samples(4.0,2.0).Take(200)); | |
// Count: 200 | |
// Mean: 4.19280609640353 | |
// Variance: 3.88181490721677 | |
// Min, Max, StandardDeviation, Skewness, Kurtosis; Population-* | |
var b = new RunningStatistics(); | |
b.Push(8.0); | |
b.PushRange(Normal.Samples(8.0,1.0).Take(199)); | |
// Count: 200 | |
// Mean: 7.98480924115135 | |
// Variance: 0.912238640131415 | |
var c = a + b; // or RunningStatistics.Combine(a,b) | |
// Count: 400 | |
// Mean: 6.08880766877744 | |
// Variance: 5.99485072907276 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let a = RunningStatistics (Normal.Samples(8.0, 1.0) |> Seq.take 200) | |
let b = RunningStatistics() | |
b.Push 8.0 | |
b.PushRange (Random.shared |> Sample.normalSeq 4.0 2.0 |> Seq.take 199) | |
let c = a + b; // or RunningStatistics.Combine(a,b) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment