Questions about performing probabilistic calculations, especially those concerned with the Mathematica commands Probability, Expectation and the various functions related to distributions such as NormalDistribution, CDF, PDF etc.

learn more… | top users | synonyms

30
votes
6answers
2k views

Efficient way to generate random points with a predefined lower bound on their pairwise Euclidean distance

Using Mathematica what is an efficient way to generate a list of $n$ random two dimensional points $\{x_i,y_i\}$ where $i=1,...,n$ so that no two points $p_1$ and $p_2$ in the list has an Euclidean ...
11
votes
3answers
3k views

How to generate a RandomVariate of a custom distribution?

I'm trying to generate a pseudorandom variate out of a custom distribution. Suppose I want define a custom distribution, and for the sake of simplicity I define a Poisson distribution (the ...
28
votes
1answer
2k views

RandomVariate from 2-dimensional probability distribution

A probability distribution can be created in Mathematica (I am using 8.0.1) with e.g. ...
9
votes
2answers
953 views

Mathematica Package for Bayesian Networks

Are there any packages that allow the simulation of Bayesian Networks with Mathematica? I found what seemed to be a promising package (Dynamics) on a Brown University URL, ...
4
votes
3answers
354 views

Plotting the convolution of the same probability density function with itself

I would like to compute the integral $$q_n(x)=\int_{B}^A q_{n-1} (\omega)f(x-\omega)\mathrm{d} \omega,\quad q_1=f,\quad n\geq 1.$$ for a given density function $f$. Basically it is the convolution ...
4
votes
3answers
638 views

Graphical Plots of PDF and CDF

I have a joint density and distribution function that I want to plot in a meaningful way, (i.e., want to be able to see how the functions behaves as changes in x and y happen simultaneously. If ...
3
votes
1answer
149 views

Determining the dimension of a probability distribution

Functions like Mean and RandomVariate clearly infer the dimension of the distribution passed to them. One can also usually ...
3
votes
2answers
95 views

Expectation of a composite Markov-Gamma distribution

In a model I have a discrete two-state first order Markov process, defined by a (2x2) transition matrix with two free parameters. If the first state occurs then the process outputs zero for that ...
0
votes
1answer
69 views

Estimating Parameters of a Custom Distribution

The problem is I can not get estimation of parameters of any custom probability distribution (distributions are not built in Mathematica), here is an example: First: I entered random numbers of ...
14
votes
2answers
1k views

Obtaining joint distributions and conditional distributions using Mathematica

I have two multivariate Gaussian distributions $p(x)$ and $p(z)$ with mean vectors $m_x$ and $m_z$, and covariance matrices $\Sigma_x$ and $\Sigma_z$. my model is a simple linear model $x = W z+n$ ...
8
votes
1answer
845 views

Mathematica code for hidden Markov models (HMM)

I am looking for some simple Mathematica code to model an HMM with just a few states and an equal number of observable signals (emissions). I am hoping to generate sample paths and keep track of the ...
6
votes
1answer
238 views

Speeding up the non-negativity algorithm for multilinear function with interval probabilities?

The algorithm is a branch-and-bound algorithm that calculates the non-negativity of a multilinear function with interval probabilities. The lines 9-11 has an optimization that is explained on the ...
5
votes
1answer
267 views

How to solve this probability symbolically or numerically?

I am trying to calculate the following probability $$\mathbb{P} \big(\sum_{i=1}^{m} (A_i + S_i) \le L < \sum_{i=1}^{m+1} (A_i + S_i) \big)$$ where, $$A_i \sim \exp(\lambda), \quad S_i \sim ...
4
votes
4answers
526 views

Generate random points in a region with higher probability in a sub-region

I am trying to generate random samples of points in the unit square in such a way that points inside a given circle are twice as likely to be selected as points outside of that circle. I tried to ...
10
votes
6answers
1k views

2D Gaussian distribution of squares coordinates

I would like to imitate the structure of this great painting from Ellsworth Kelly in Mathematica. Yet with all the colored squares in Black and the beige one in white. Below is what I have wrote to ...
3
votes
1answer
344 views

Categorical Distribution

Suppose I want to do calculations with a random variable $X$ that has a simple categorical distribution (a.k.a generalised Bernoulli distribution or discrete distribution). I was expecting to be able ...
1
vote
1answer
236 views

Detecting a nonlinear edge in a 2D point pattern

Following an earlier post here, I have generated a point pattern on the unit square $[0,1]\otimes[0,1]$, which is described by a piecewise constant intensity function constructed so that (in ...
10
votes
4answers
419 views

Extracting equations from Piecewise expressions

Say I have a PDF: PDF[LogNormalDistribution[1.75, 0.65], x] Calculating it, Mathematica gives me an expression that looks like this: I want to extract the ...
8
votes
2answers
553 views

Expected Value: Strange/unexpected result

Assume $X$ is an exponential random variable with unit mean ($f_X(x)=e^{-x}$, $x>0$). I want to calculate the expected value of $\frac{1}{X}$. Since $X>0$, I am expecting that ...
8
votes
1answer
413 views

Random variables with transformed discrete distributions cannot be applied to Probability[] function?

I have two discrete uniform distributions over same support: Dx = DiscreteUniformDistribution[{-8, 8}]; Dy = DiscreteUniformDistribution[{-8, 8}]; I use ...
5
votes
4answers
323 views

Probability: proportion of 1000 random lists for x that contain the same nrs

Give a function which calculates for each x a random list of birthdays (which can be x=1 to x=365) birthdays[x_] := RandomInteger[{1, 365}, x] is my answer. ...
4
votes
2answers
482 views

Why does this integral have a complex component?

I wanted to find the probability of my normally-distributed random variable being at least 15, so I set up this integral: ...
3
votes
2answers
109 views

RandomFunction and Histograms

RandomFunction[QueueingProcess[3, 5], {0, 15}] Histogram[data, Automatic, "PDF"] gives a very nice way to see the histogram based on the specified process. ...
2
votes
1answer
51 views

Create a ProbabilityDistribution

I am trying to wrap my head around the function ProbabilityDistribution. For training purpose, I'd like to recreate the binomial distribution (without using it) so that the two code lines return the ...
1
vote
1answer
125 views

What is the PDF of a variable where a parameter is itself a random variable?

Question How do we analyze in Mathematica cases where a parameter in a Probability Density Function (PDF) varies according to another PDF? Consider the following example... Example The text below ...
1
vote
1answer
80 views

Function of a random variable

Here is a probability density function (PDF) pdfq[q_] = C q^(4 n ν - 1) (1 - q)^(4 n μ - 1) $$P_q(Q=q) = C q^{4 n\nu - 1} (1 - q)^{4 n \mu - 1}$$ I'd like to ...