• Stars
    star
    256
  • Rank 159,219 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 9 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Javascript library for the visualization of statistical distributions

stat-distributions-js

Javascript library for the visualization of statistical distributions

What the library does

Allows for interactive visualizations of probability distributions. The goal of this library is to offer a simple way to define any distribution one likes, and then to immediately be able to interact with the parameters of the distribution and see how the distribution changes.

Live demo

Screen1

Screen2

Screen3

There are two HTML files:

  • distributionTable.html: Lists all known distributions in a table, giving links for interaction with each
  • distributionDisplay.html: Gives an interface to interface with a specific distribution

distributionDisplay.html can be used directly using URL parameters, e.g.:

https://richarddmorey.github.io/stat-distributions-js/distributionDisplay.html?dist=normal&ptzn=2&plotxrng=50,150&rangesLo=50,3&rangesHi=150,45&starts=100,15

The setup parameters used here are:

  • dist: the distribution name
  • ptzn: the parametrization number (array index; here 2 means mean/standard deviation)
  • plotxrng: the lower and upper limit of the x axis
  • rangesLo: the lower bound for the slider for each parameter
  • rangesHi: the upper bound for the slider for each parameter
  • starts: starting values for the parameter sliders

How it works

The javascript file distributionList.js defines an array of distribution objects, each of which represents a probability distribution.

Distibutions

A distribution is defined by a distribution object, e.g.

distributions["normal"] = new distribution(
	"normal",            // label
	"Normal/Gaussian",   // display name
	"continuous",        // type
	[ normalMeanVariance, normalMeanPrecision ], // array of parametrizations
	null,                // note 
	{   // information source about the distribution
		name:"Wikipedia",
		link:"http://en.wikipedia.org/wiki/Normal_distribution"
	}
);

New distributions can be defined analgously.

Parametrizations

Every distribution must have at least one parametrization. Most of the important information about the distribution is in the parametrization object. See the distributionObjects.js file for more details, and the distributionList.js file for examples.

Libraries used

Uses the following libraries:

Old (known working) versions of these libraries are included in this repository.

More Repositories

1

BayesFactor

BayesFactor R package for Bayesian data analysis with common statistical models.
R
132
star
2

ConfidenceIntervalsFallacy

The Fallacy of Placing Confidence in Confidence Intervals
HTML
37
star
3

studentProjectAllocation

An implementation of Abraham et al's (2007) algorithm for allocation of student projects
JavaScript
31
star
4

psychology_resolution

Paper and code for Morey and Lakens (in prep.)
TeX
24
star
5

tweetRcode

Rstudio addin to tweet from Rstudio
R
23
star
6

flexTeaching

Use rstudio flexdashboards to create random stats assignments
JavaScript
17
star
7

divergingPips

R package for creation of "diverging pip" plots
R
13
star
8

encrypt_data_example

Shows how to encrypt data held in public space
R
11
star
9

jpower

functions to compute power for various designs
R
10
star
10

responseToHoijtink

A response to Hoijtink et al's "Why Bayesian psychologists should change the way they use the Bayes factor"
HTML
9
star
11

trumpHands

How small are Trump's hands?
R
7
star
12

nullHistoryAMPPS

Text, data, and code for "Of waves and peas: Accepting the null across scientific history"
HTML
4
star
13

Morey_Hoekstra_StatCognition

Data, materials, and code for statistical cognition experiments by Morey and Hoekstra
TeX
4
star
14

RcompileSlides

Simple package with addin to compile Rmarkdown slides to HTML and PDF
R
4
star
15

RprojectDemo

An example of a research project layout
HTML
4
star
16

BayesFactorExtras

Extra functions for use with the BayesFactor R package
HTML
4
star
17

ExampleDatasets

Real data sets organized in "data packs" for teaching
HTML
3
star
18

lexicalDistance

Data from a cognitive experiment run in Rouder's Perception and Cognition lab
JavaScript
3
star
19

WMCapacity

A GUI R implementation of hierarchical Bayesian models of working memory, used for analyzing change detection data.
R
3
star
20

MillerUlrichResponse

A response to Miller and Ulrich's "Interpreting Confidence intervals: A comment on Hoekstra, Morey, Rouder, and Wagenmakers (2014)"
TeX
3
star
21

jspower

A javascript power interface
JavaScript
2
star
22

absoluteJudgmentCalibration

Data from my unpublished Masters thesis.
HTML
2
star
23

priorDemo

A demo of various prior distributions for a Bayes factor t test.
R
2
star
24

EssexSummerSchoolBayes

Materials for Bayesian Analysis for the Social Sciences at the Essex Summer School
R
2
star
25

bf_jamovi

Jamovi interface to BayesFactor
JavaScript
1
star
26

jspower-site

The website companion for richarddmorey/jspower (using vue.js, jekyll)
Vue
1
star
27

mattersofsignificance

A archival collection of objections to significance testing
TeX
1
star
28

contingencyTablesShiny

Interactive demonstration of contingency table statistics
R
1
star
29

encryptRmd

R package to encrypt chunk outputs in HTML compiled from Rmd documents
R
1
star
30

surveyjsR

R package for using surveyjs surveys in Rmarkdown
JavaScript
1
star