Created
March 28, 2018 21:25
-
-
Save matteo-grella/431a1b958ae119784792d39d77cb6d58 to your computer and use it in GitHub Desktop.
Simple Method to Calculate the Incremental Average
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
fun incrementalAverage(previousAverage: Double, value: Double, iterationIndex: Int): Double { | |
return (value - previousAverage) / (iterationIndex + 1) + previousAverage | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment