Correlated Bernoulli Variables Calculator
Enter exactly three values to compute the rest. User-entered values are black, calculated values are grey. Invalid states are shown in red.
1 |
Conditional Probabilities
Correlation
Visualizations
Formulas
Controls
Summary Statistics
Sampling
Density plot
Controls
Summary Statistics
Density plot
Formulas
The marginal density of the k-th order statistic
In a sample of size \(n\), the CDF and PDF of the \(k\)-th order statistic, \(X_{(k)}\), are:
$$ \begin{aligned} \mathbb{P}(X_{(k)} \le x) &= \sum_{i=k}^n {n \choose i} F(x)^i(1-F(x))^{n-i} \\ f_{X_{(k)}}(x) &= k{n\choose k}f(x)F(x)^{k-1}(1-F(x))^{n-k} \end{aligned} $$Marginal Distributions
Marginal for X
Marginal for Y
Dependence Structure
Samples from Joint Distribution
Conditional Density
Formulas
Let \(u = F_X(x)\), \(v = F_Y(y)\), \(x' = \Phi^{-1}(u)\), and \(y' = \Phi^{-1}(v)\).
Conditional on \(X=x\)
$$ f_{Y|X}(y|x) = \frac{f_Y(y)}{\phi(y')} \frac{1}{\sqrt{1-\rho^2}} \phi\left(\frac{y' - \rho x'}{\sqrt{1-\rho^2}}\right) $$Conditional on \(X \ge x\)
$$ f_{Y|X \ge x}(y) = \frac{f_Y(y)}{1-u} \left[ 1 - \Phi\left(\frac{x' - \rho y'}{\sqrt{1-\rho^2}}\right) \right] $$Conditional on \(X \le x\)
$$ f_{Y|X \le x}(y) = \frac{f_Y(y)}{u} \Phi\left(\frac{x' - \rho y'}{\sqrt{1-\rho^2}}\right) $$Process Parameters
\( dX_t = m\,dt + \sigma\,dW_t \)
Sample Paths of \( X_t \)
First Hitting Time \( T_b \)
Density of \( T_b = \inf\{t \ge 0 \mid X_t = b\} \)
Hitting Probability \( \mathbb{P}(T_b \le t) \)
Hitting Probability by Barrier distance
\( \mathbb{P}(\{X_t = b \text{ for any } 0\le t\le T\}) \) as a function of barrier \(b\)
Formulas
Distribution of the process at time \(t\)
The value of the process \(X_t\) at time \(t\) is normally distributed:
$$ X_t \sim \mathcal{N}(X_0 + mt, \sigma^2 t) $$First Hitting Time
Let \(a = b - X_0\) be the distance to the barrier. The first time the process hits the barrier, \(T_b = \inf\{t \ge 0 \mid X_t = b\}\), follows an Inverse-Gaussian distribution with PDF:
$$ f_{T_b}(t) = \frac{|a|}{\sigma\sqrt{2\pi t^3}} e^{-\frac{(a-mt)^2}{2\sigma^2 t}} $$Hitting Probability by time \(T\)
The probability of hitting the barrier \(b\) at or before time \(T\) is:
$$ \mathbb{P}(T_b \le T) = \Phi\left(\frac{mT-a}{\sigma\sqrt{T}}\right) + e^{\frac{2ma}{\sigma^2}} \Phi\left(\frac{-mT-a}{\sigma\sqrt{T}}\right) $$where \(a=b-X_0\) and \(\Phi\) is the standard normal CDF. This applies when \(a > 0\). If \(a < 0\), the signs of both \(a\) and \(m\) are flipped.
About
This is a web app that helps you do quick probability calculations on your phone or computer.
What the app can do:
- Plot probability distributions of widely used continuous and discrete distributions, and compute summary statistics.
- For any probability density graph, compute the area under the curve (click and move over the density graphs). Useful for e.g. estimating tail probabilities of conditional variables.
- Compute the density of order statistics of i.i.d. variables (for example if you want to know what the 2nd largest of 10 samples is).
- Plot, generate samples, and compute summary statistics of dependent variables (either continuous, or Bernoulli variables).
- Compute Brownian Motion sample paths, first hitting time distributions, and hitting probabilities.
How it works
For all calculations there are either closed form solutions available, or some simple numeric calculations. The app uses numeric.js and jStat for most calculations. The values you input never leave your device, all computation is done locally.
The graphs and visualizations are created using d3.js.
If you make consequential decisions, don’t solely rely on the answers given here, you should perhaps double check the results with some Python code.
Bugs/Contributions
The code is available on GitHub. You are welcome to open issues there, or better yet, send a pull request. The purpose of the app is to enable quick and easy probability calculations – so I won’t be accepting contributions of the form “enter 20 data points and compute statistic X”, you’d want a proper data science environment for that.
Author & License
Copyright 2025 Julius Plenz. Published under the MIT license.
Install Probly
For a better experience, you can install this application on your device. It will work offline and feel like a native app. Click the button below to install.
