For questions about distributions built-in in Mathematica, and functions that operate on them. Also includes questions about defining your own distributions.

learn more… | top users | synonyms (1)

34
votes
8answers
2k views

How to generate random points in a region?

The Mathematica 10 documentation was updated for FindInstance adding support for regions. In my use case, I'm trying to sample points in a set of disks: ...
32
votes
1answer
3k views

RandomVariate from 2-dimensional probability distribution

A probability distribution can be created in Mathematica (I am using 8.0.1) with e.g. ...
25
votes
3answers
3k views

Standard errors for maximum likelihood estimates in FindDistributionParameters

I am trying to fit a non-standard PDF to data and FindDistributionParameters works great, and gives me the parameters of the distribution back using maximum ...
21
votes
4answers
2k views

Visualization of Bivariate Distributions

I know it is perfectly possible to show the bivariate probability distributions in MMA. But my question is can we show each dimension of distribution in 2D dimension while we are showing the 3D plot? ...
21
votes
2answers
1k views

Efficient Generation of Random Variates from a Copula Distribution

I have a 7-asset portfolio for which I want to simulate daily log-deltas using a Student T copula. The marginal distributions are all either Stable or TsallisQGaussian. Using NMaximize, I have ...
21
votes
2answers
679 views

Given an exact formula, how can Mathematica find a probability distribution whose PDF matches it?

So, given some data, Mathematica 10.2 can now attempt to figure out what probability distribution might have produced it. Cool! But suppose that, instead of having data, we have something that is in ...
16
votes
2answers
269 views

More efficient method to compute moments of the Johnson $S_B$ distribution

Here is a very specific feature request. I need Mean[JohnsonDistribution["SB", γ, δ, 0, 1]] When I issue e.g. ...
16
votes
3answers
6k 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 ...
16
votes
1answer
633 views

Speed up adding Poisson noise to an image

I'm simulating some images corrupted with Poisson noise, but I'm encountering a few problems with performance. According to the documentation on ImageEffect, one ...
16
votes
2answers
2k 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$ ...
16
votes
2answers
1k views

How to compute the inverse CDF of HyperbolicDistribution properly?

Fixed in version 9. I want to compute the CDF and inverse CDF of the hyperbolic distribution: ...
15
votes
1answer
398 views

RandomVariate returns values outside the support of a PDF

Bug introduced in 8.0.1 and fixed in 10.2.0 Let $X$ be a random variable with pdf: dist = ProbabilityDistribution[1/(Abs[x]*Log[Abs[x]]^2), {x, -E^-2, E^-2}] ...
13
votes
3answers
170 views
13
votes
2answers
2k views

Finding distribution parameters of a gaussian mixture distribution

Short version: how to estimate the parameters of a mixture of multivariate normal distributions (i.e.: Gaussian mixture model)? Long version. I am trying to estimate the parameters of a mixture of ...
12
votes
4answers
319 views

Frequency of punctuation characters used in Mathematica languages

I would like to determine the computer language character frequency in Mathematica code. I want to remap my keyboard to the most used character such as [], {}, -, +. There are the frequency of ...
12
votes
1answer
2k views

Probability and distribution from actual data

Let's say I have some data from a real world system: ...
12
votes
2answers
297 views

Sampling a phase space uniformly for a given energy?

The energy for a 1D harmonic oscillator can be written: $$ E = \frac{1}{2 m} p^2 + \frac{m \omega^2}{2} x^2 $$ where x is position and p is the momentum. I would like to sample phase space $(x,p)$ ...
11
votes
2answers
653 views

Generating uniform random points over a binary image

So I recently read this excellent post about generating random points over arbitrary regions. I hope Wolfram eventually builds that functionality into Mathematica's Random functions. I want to do this ...
11
votes
2answers
1k views

Trying to fit an unknown extreme distribution

First up, I'm quite new to Mathematica so any hints on better code would be greatly appreciated. I have some histogram frequency data from an unknown distribution that I'm trying to fit. Here's the ...
11
votes
1answer
216 views
10
votes
2answers
486 views

What do the options of SmoothKernelDistribution do?

The function SmoothKernelDistribution has three options that are not described in too much detail in the Mathematica's help window. InterpolationPoints: What is ...
10
votes
2answers
136 views

Probability: MultivariateHypergeometricDistribution broken with more than five categories?

2016-04-09: This bug is indeed fixed (thank you, Stefan R.!) in 10.4. It may have been fixed in 10.3 or 10.3.1, but I haven't tried these versions. ...
10
votes
2answers
164 views

Possible bug in VonMisesDistribution?

Bug introduced in 10.2 or earlier and fixed in 10.3 Observe: ...
10
votes
2answers
504 views

Compiling the VoigtDistribution PDF

According to List of compilable functions, Erf and Erfc are compilable functions. However, I want to make a compiled version ...
10
votes
1answer
329 views

How does LocationTest choose its “AutomaticTest”?

Is there a way of determining how LocationTest chooses its "AutomaticTest"? Sometimes it's clear from the ...
10
votes
1answer
105 views

FullSimplify on TransformedDistribution

Bug introduced in 8.0.0 and fixed in 10.3.0 Could someone check that I haven't gone mad? I would like to take the maximum of two $[0, 2 \pi]$ independent uniform random variables. ...
9
votes
2answers
3k views

What is the best distribution for my histogram?

I defined a security bound for a random walk (cube with 15 lengh) and i have this code to obtain a sample of the random times at which the random walk crosses the boundary for the first time: ...
9
votes
3answers
164 views

Linear fit with conditional noise distribution

I need to fit a linear model of the form $y_i = a · x_i + b + e_i$. The $e_i$ are independent noise from a distribution that depends on $x$ as well as on global parameters of the data; however, the ...
9
votes
1answer
249 views
9
votes
3answers
670 views

The default bandwidth of the SmoothKernelDistribution function

I am researching the Silverman rule of thumb for bandwidth selection. Below is a sample of my code, from which it seems that BW=63 is close to the default parameter given by Mathematica (2 images are ...
9
votes
2answers
133 views

Why are Binormal and Multinormal giving me different results when I use NExpectation?

fixed in 10.1 (windows) Binormal and Multinormal can both be used to represent normal random variables: ...
8
votes
3answers
309 views

How to evaluate if a list obeys the Normal distribution?

I am processing a data when I encountered this problem. I use the way of plotting the "normal probability plot" to show the result The list I have is: ...
8
votes
1answer
358 views

Inconsistent DistributionFitTest results?

In pondering this question, I used Mariana's function to generate the following data. ...
8
votes
1answer
154 views

AndersonDarlingTest and DistributionFitTest Leaking Memory

I believe AndersonDarlingTest and probably all other tests are keeping a copy of data somewhere and not freeing it: ...
7
votes
3answers
588 views

How to randomly erode a 3D distribution of points with Mma 7.0?

Suppose we have a 3D distribution of points, like the spherical ball example below : ...
7
votes
2answers
263 views

Is there any function that compares distributions of two populations?

Imagine I have two populations that I want to test whether they exhibit similar shape distributions. Is there such a function that does this sort of testing already implemented? I am asking this ...
7
votes
3answers
244 views

Distribution over the product of three, or n, independent Beta random variables

I would like to calculate the PDF for the product of three independent Beta random variables. Specifically, I would like to find the distribution of the product of the following: $X_1\sim ...
7
votes
1answer
218 views

RandomVariate does not fill range of PDF of distribution

I've declared my own probability distribution as follows dist[a_, b_] := ProbabilityDistribution[Cos[(b x)/2]^2 Sinc[a x]^2, {x, -400, 400}]; When I try to ...
7
votes
4answers
230 views

How to generate two group of $n$ random numbers in $U(0,1)$ such that sum of these two groups equal? [closed]

I want to have two groups of $n$ random numbers $u_i$ and $v_i$ in $U(0,1)$, such that $\sum u_i = \sum v_i$ What I tried is: I can firstly get $u_i$ by ...
7
votes
1answer
318 views

How to create a spliced survival statistical distribution?

I am trying to use Mathematica for more of my reliability engineering work and am having trouble using SplicedDistribution. I have a Weibull distribution (dist1) associated with a low stress ...
6
votes
2answers
246 views

Nearest neighbor distribution

I need to construct nearest neighbor distribution for a given finite set of real numbers. I have no clue how this can be realized. Any suggestion would be very much appreciated.
6
votes
1answer
1k views

Is there a free version of the Springer book “Mathematical Statistics with Mathematica”?

Is there a free version of the Springer book: $$\text{Mathematical Statistics with Mathematica}$$ by Rose and Smith ... available on the internet?
6
votes
2answers
124 views

Scale SmoothHistogram curve to Histogram

Like in this question, I would like to display a histogram and a smooth histogram in the same plot. I believe the default “bin height specification” (or $\textit{hspec}$) for ...
6
votes
1answer
370 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 ...
6
votes
1answer
96 views

RandomVariate of a custom distribution gives only negative points

I don't understand why the following code ...
6
votes
2answers
243 views

When analytical and numerical methods do not agree - Case study with Maximum Likelihoods methods

Here is the probability distribution I am interested in: $$P(q)=C e^{4 n s q} q^{4 n \nu - 1} (1 - q)^{4 n \mu - 1}$$ , where $e$ is the constant of Euler and $C$ is constant so that the whole thing ...
6
votes
1answer
462 views

How can I create a Distribution from its probability density function?

I have a probability density function. Is there a mechanism to create a Distribution object from it, such that normal Mathematica commands that usually work on ...
6
votes
2answers
202 views

Best way to represent a joint distribution

The motivation for this question is producing a distribution that produces the gender and age of an individual when the distribution of ages depends on gender. Suppose I want a distribution which, ...
6
votes
1answer
114 views

P-values differ in tests for normality between Mathematica and SAS

I am testing the following data for normality, in Mathematica and SAS: ...
6
votes
1answer
213 views

How to get probabilities for multinomial & hypergeometric distribution ranges more quickly?

I often need to calculate the probability of a result from a multinomial distribution falling within some range, e.g., the maximum of the categories having an upper bound, or a lower bound for the ...