From b0dbcbaa8d4f1b91b61b2b3056055cc145d656d3 Mon Sep 17 00:00:00 2001 From: Adrian Lanzafame Date: Fri, 26 Apr 2019 12:20:31 +1000 Subject: [PATCH] add reference to original prob.go License: MIT Signed-off-by: Adrian Lanzafame --- monitor/metrics/prob.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/monitor/metrics/prob.go b/monitor/metrics/prob.go index 02d62ca7..abe82d5e 100644 --- a/monitor/metrics/prob.go +++ b/monitor/metrics/prob.go @@ -18,6 +18,8 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Reference of what was originally copied: https://ipfs.io/ipfs/QmeJDSL6g6u4NSuzUqRxZWhyKPJ6wJAqieQpqX5eXPCjj5 */ package metrics @@ -30,7 +32,7 @@ import ( // phi returns the φ-failure for the given value and distribution. // Two edge cases that are dealt with in phi: -// 1. phi == math.+Inf +// 1. phi == math.+Inf // 2. phi == math.NaN // // Edge case 1. is most certainly a failure, the value of v is is so large @@ -53,7 +55,7 @@ func phi(v float64, d []float64) float64 { return phi } -// CDF returns the cumulative distribution function if the given +// cdf returns the cumulative distribution function if the given // normal function, for the given value. func cdf(u, o, v float64) float64 { return ((1.0 / 2.0) * (1 + math.Erf((v-u)/(o*math.Sqrt2))))