Skip to content

An interactive example of a function applied to a random variable showing the resulting distribution.

Notifications You must be signed in to change notification settings

laszlokorte/random-variable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Screenshot of the app

Live Demo | Short demo video

Function applied to random variables

Applying a function to a random variable affects the resulting distribution. The colored rectangles represent the density of the random variable along the X axis. You can see how squaring the variable shifts all rectangles into the positive range. Each colored rectangles keeps its area but is stretched along the X axis by 2x (the derivative of x2). Accordingly the height of each rectangle is compressed by 2x to keep the area constant.

As x^2 is not injective multiple rectangles end up at the same target along the x axis. They simply stack on top of each other to represent the resulting probability density at each location.

Clicking on a single rectangle highlights its corresponding partner rectangle in the other distribution.

Lowering the number of bins makes the individual rectangles more recognizable but reduces the precision of the probability density.

About

An interactive example of a function applied to a random variable showing the resulting distribution.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published