atgjack / prob Goto Github PK
View Code? Open in Web Editor NEWA GoLang library providing statistics and sampling for probability distributions.
A GoLang library providing statistics and sampling for probability distributions.
Returning math.NaN()
is preferable to throwing an error. Also, when a validation occurs, a NaN
should be used instead of 0.0
.
Currently there are none. Need to find a valid resource for generating values against.
I added the Negative Binomial distribution in #32 . Needs a better sampling test.
Similar to #1. Add some discrete distributions.
Will probably update this list as I come up with more.
I'd like at least the following added:
I added the Chi-Squared distribution in #12. The sampling tests are lame. I need to find a better way to verify them.
I added the Student's t-distribution in #14. The sampling tests are lame. I need to find a better way to verify them.
I added the Cauchy distribution in #4 but it's sampling tests are not really valid.
Looking for a better way to test this.
I've been using math.Pow
for simple exponents, and that's probably got a small performance penalty.
Here is a list of where it's called.
grep -rno math.Pow
The chi square CDF does not account for underflow or overflow and therefore can emit (very) wrong answers.
package demo
import (
"math"
"testing"
"github.com/atgjack/prob"
)
func TestProb(t *testing.T) {
N := 200.0
v := prob.ChiSquared{1}
t.Log(1 - v.Cdf(N))
}
This will yield ~ 0.4933. The correct answer is approximately 0. Either extremes chi square values should be handled, or an error (or a panic, as is done by the probab/dst functions) should be returned. (I'm using github.com/tokenme/probab/dst
instead so I don't plan on submitting a pull request -- my apologies -- but I do want to at least mention the issue.)
Update function names and change throughout source.
Choose
should be BinomialCoefficient
Lowerincgamma
It looks like each distribution's Sample
method is returning []float64{}, nil
when it should be []float64, err
. Need to go back through and fix this.
I added the Log-Normal distribution in #29. The sample average is fine, but the variance is off by quite a bit. This probably has to do with the natural log, but I need to fix this to test more accurately.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.