Giter VIP home page Giter VIP logo

prob's People

Contributors

atgjack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

prob's Issues

Add discrete distributions.

Similar to #1. Add some discrete distributions.

Discrete Distributions:

  • Binomial
  • Negative Binomial
  • Poisson
  • Geometric
  • Hypergeometric
  • Multinomial

Add more distributions

Will probably update this list as I come up with more.
I'd like at least the following added:

Continuous

  • Cauchy
  • Chi-Square
  • Exponential
  • Gamma
  • Normal
  • Pareto
  • Student's T
  • Uniform
  • Weibull
  • Beta
  • Logistic
  • Log-Normal
  • F
  • Laplace

Optimize math.Pow calls.

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

Overflow/underflow

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.)

Rename special functions

Update function names and change throughout source.

  • Choose should be BinomialCoefficient
  • A better name for Lowerincgamma

Make sampling method return error.

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.

Better tests for log-normal sampling.

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.

Better tests for the pareto sampling.

I added the Pareto distribution in #8. The sampling test seems alright, but I found this when looking for better tests.

Basically, it suggests estimating the parameters and comparing them to the base distribution. Seem's pretty simple to implement.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.