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
This is part of a series of examples that describe the basic operation of | |
the [D3.js](http://d3js.org) [force layout](https://github.com/mbostock/d3/wiki/Force-Layout). | |
Eventually they may end up in a blog post that wraps everything together. | |
The first example creates the simplest possible graph using a force layout. | |
The comments in the code walk through the steps in creating a force directed | |
graph. | |
Things start to get more interesting in the [next example](http://jsdatav.is/visuals.html?id=11560633). |
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
This is part of a series of examples that describe the basic operation of | |
the [D3.js](http://d3js.org) [force layout](https://github.com/mbostock/d3/wiki/Force-Layout). | |
Eventually they may end up in a blog post that wraps everything together. | |
If you missed the beginning of the series, here's a link to | |
[first example](http://jsdatav.is/visuals.html?id=11550728). | |
Before digging into the properties and options of the force layout, it's | |
helpful to understand how the layout works more generally. And although | |
there's some serious mathematics going on under the hood, the principle | |
is pretty simple: The layout moves the graph nodes around a little bit |
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
This is part of a series of examples that describe the basic operation of | |
the [D3.js](http://d3js.org) [force layout](https://github.com/mbostock/d3/wiki/Force-Layout). | |
Eventually they may end up in a blog post that wraps everything together. | |
If you missed the beginning of the series, here's a link to | |
[first example](http://jsdatav.is/visuals.html?id=11550728). | |
Earlier examples looked at the operation of force layout from a (very) | |
high level. This example begins examining the important properties of | |
the force layout in more detail. |
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
This is part of a series of examples that describe the basic operation of | |
the [D3.js](http://d3js.org) [force layout](https://github.com/mbostock/d3/wiki/Force-Layout). | |
Eventually they may end up in a blog post that wraps everything together. | |
If you missed the beginning of the series, here's a link to | |
[first example](http://jsdatav.is/visuals.html?id=11550728). | |
The [previous example](http://jsdatav.is/visuals.html?id=83515b77c2764837aac2) | |
shows how `linkDistance` tells the force layout the desired distance | |
between connected nodes. It may seem strange that D3 doesn't simply | |
compel all links to be that distance. The force layout, however, takes |
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
This is part of a series of examples that describe the basic operation of | |
the [D3.js](http://d3js.org) [force layout](https://github.com/mbostock/d3/wiki/Force-Layout). | |
Eventually they may end up in a blog post that wraps everything together. | |
If you missed the beginning of the series, here's a link to | |
[first example](http://jsdatav.is/visuals.html?id=11550728). | |
The [previous example](http://jsdatav.is/visuals.html?id=1ca23ee9588580d768aa) | |
shows how `charge` can influence the distance between connected nodes and | |
prevent the layout from achieving the desired `linkDistance`. That's not | |
the main purpose of the `charge` force, however. It exists mostly to |
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
This is part of a series of examples that describe the basic operation of | |
the [D3.js](http://d3js.org) [force layout](https://github.com/mbostock/d3/wiki/Force-Layout). | |
Eventually they may end up in a blog post that wraps everything together. | |
If you missed the beginning of the series, here's a link to | |
[first example](http://jsdatav.is/visuals.html?id=11550728). | |
An [earlier example](http://jsdatav.is/visuals.html?id=83515b77c2764837aac2) | |
introduced `linkDistance` as a key parameter for force layouts. It | |
sets the desired distance between any connected nodes. The force | |
layout includes an additional parameter that serves to modify the |
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
This is part of a series of examples that describe the basic operation of | |
the [D3.js](http://d3js.org) [force layout](https://github.com/mbostock/d3/wiki/Force-Layout). | |
Eventually they may end up in a blog post that wraps everything together. | |
If you missed the beginning of the series, here's a link to | |
[first example](http://jsdatav.is/visuals.html?id=11550728). | |
The code in the previous examples has mentioned a property that D3 calls | |
_gravity._ The force layout uses this property to keep nodes from wandering | |
off the edges of the visualization, something they might otherwise do to | |
avoid overlap. |
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
This is part of a series of examples that describe the basic operation of | |
the [D3.js](http://d3js.org) [force layout](https://github.com/mbostock/d3/wiki/Force-Layout). | |
Eventually they may end up in a blog post that wraps everything together. | |
If you missed the beginning of the series, here's a link to | |
[first example](http://jsdatav.is/visuals.html?id=11550728). | |
The final parameter this series considers is `friction`. This parameter, which | |
ranges from 0 to 1, tells D3.js how much (if at all) to slow down the layout | |
at each iteration. With a value of 1, the layout never slows down, while a | |
value of 0 forces all the nodes to immediately stop. |
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
This graph shows the top 25 jazz albums of all time (at least according to [one blogger](http://www.thejazzresource.com/top_25_jazz_albums.html).) Links between the albums represent musicians that played on both. Click on the nodes and the links for more information. | |
> Note: iTunes links are _not_ affiliate links. | |
This visualization is a real application of the [D3.js](http://d3js.org) [force layout](https://github.com/mbostock/d3/wiki/Force-Layout). It demonstrates some of the principles in a series on that layout. You can review that series beginning with the [first example](http://jsdatav.is/visuals.html?id=11550728). |
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
*** Forked from the original by Stephen A Thomas (sathomnas) *** | |
Thanks to the excellent [bayes.js](http://www.sumsar.net/blog/2015/12/bayes-js-a-small-library-for-doing-mcmc-in-the-browser/) library from Rasmus Bååth it's now possible to experiment with Bayesian statistics in JavaScript. We'll take advantage of that library in this series of posts, which demonstrate Bayesian statistics visually for anyone with a web browser. | |
This first post covers Markov Chain Monte Carlo (MCMC), algorithms which are fundamental to modern Bayesian analysis. MCMC is also critical to many machine learning applications. Since this is the first post, though, we'll start with a brief introduction to Bayesian statistics. | |
## Bayes' Rule in Probability | |
The simplest form of Bayesian analysis arises in probability, not statistics, in the form of _Bayes' Rule_ (or _Bayes' Theorem_). Bayes' Rule describes relationships between conditional probabilities. Formally, it says: |