Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
stuhlmueller committed May 25, 2016
2 parents 86f13e0 + f3504df commit 75d9fc4
Show file tree
Hide file tree
Showing 96 changed files with 2,214 additions and 1,646 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ bundle/
docs/_build
docs/_static
docs/_templates
src/erp.js
src/dists.js
src/inference/enumerate.js
src/aggregation/distribution.js
src/aggregation/ScoreAggregator.js
7 changes: 6 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var jslintSettings = {
src: [
'Gruntfile.js',
'src/header.wppl',
'src/**/!(erp|enumerate|distribution).js'
'src/**/!(dists|enumerate|ScoreAggregator).js'
]
},
test: {
Expand Down Expand Up @@ -140,4 +140,9 @@ module.exports = function(grunt) {
throw e;
}
});

grunt.registerTask('generate-docs', 'Generate documentation.', function() {
var output = child_process.execSync('scripts/distributionDocs > docs/distributions.rst');
grunt.log.writeln(output);
});
};
2 changes: 1 addition & 1 deletion docs/development/npm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ Updating the npm package

git push origin dev
git push origin master
git push origin v0.0.1 // again, use version printed by "npm version" command above
git push origin v0.0.1 // use version printed by "npm version" command above
npm publish
107 changes: 107 additions & 0 deletions docs/distributions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
Distributions
=============

.. js:function:: Bernoulli({p: ...})

* p: *probability of true*

Distribution on {true,false}

.. js:function:: Beta({a: ..., b: ...})

* a
* b

.. js:function:: Binomial({p: ..., n: ...})

* p: *success probability*
* n: *number of trials*

Distribution over the number of successes for n independent ``Bernoulli({p: p})`` trials

.. js:function:: Categorical({ps: ..., vs: ...})

* ps: *array of probabilities*
* vs: *support*

Distribution over elements of vs with P(vs[i]) = ps[i]

.. js:function:: Cauchy({location: ..., scale: ...})

* location
* scale

.. js:function:: Delta({v: ...})

* v: *support element*

Discrete distribution that assigns probability one to the single element in its support. This is only useful in special circumstances as sampling from ``Delta({v: val})`` can be replaced with ``val`` itself. Furthermore, a ``Delta`` distribution parameterized by a random choice should not be used with MCMC based inference, as doing so produces incorrect results.

.. js:function:: Dirichlet({alpha: ...})

* alpha: *array of concentration parameters*

.. js:function:: DirichletDrift({alpha: ...})

* alpha: *array of concentration parameters*

.. js:function:: Discrete({ps: ...})

* ps: *array of probabilities*

Distribution on {0,1,...,ps.length-1} with P(i) proportional to ps[i]

.. js:function:: Exponential({a: ...})

* a: *rate*

.. js:function:: Gamma({shape: ..., scale: ...})

* shape
* scale

.. js:function:: Gaussian({mu: ..., sigma: ...})

* mu: *mean*
* sigma: *standard deviation*

.. js:function:: GaussianDrift({mu: ..., sigma: ...})

* mu: *mean*
* sigma: *standard deviation*

.. js:function:: Multinomial({ps: ..., n: ...})

* ps: *probabilities*
* n: *number of trials*

Distribution over counts for n independent ``Discrete({ps: ps})`` trials

.. js:function:: MultivariateGaussian({mu: ..., cov: ...})

* mu: *mean vector*
* cov: *covariance matrix*

.. js:function:: Poisson({mu: ...})

* mu

.. js:function:: RandomInteger({n: ...})

* n

Uniform distribution on {0,1,...,n-1}

.. js:function:: Uniform({a: ..., b: ...})

* a
* b

Continuous uniform distribution on [a, b]

.. js:function:: UniformDrift({a: ..., b: ..., r: ...})

* a
* b
* r: *drift kernel radius*

1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Contents:
quickstart
usage
inference
distributions
debugging
packages
development/index

0 comments on commit 75d9fc4

Please sign in to comment.