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)

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 ...
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 ...
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? ...
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: ...
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 ...
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 ...
5
votes
2answers
1k views

what is The Formula behind the Kolmogorov-Smirnov test statistics?

I calculate the Kolmogrov-samirnov test statistic for the following data: ...
2
votes
1answer
166 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 ...
1
vote
3answers
324 views

Random non-overlapping disks in a square

I've found a nice code snippet by @belisarius from this question, that I'll reproduce here for reference: ...
1
vote
1answer
130 views

Reflecting the Polya-Aeppli distribution

How would I go about reflecting the Polya-Aeppli distribution in Mathematica about a y-axis (switching left and right) while keeping the command. The distribution will not allow negative parameters ...
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 ...
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$ ...
8
votes
1answer
358 views

Inconsistent DistributionFitTest results?

In pondering this question, I used Mariana's function to generate the following data. ...
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 ...
4
votes
1answer
190 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 ...
4
votes
3answers
1k 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 ...
2
votes
1answer
85 views

Joint Distribution with a Constant

I would like to simulate from a joint distribution multiplied by a constant. e.g. 3*NormalDistribution[0,1]*NormalDistribution[1,1] I tried using something like ProductDistribution but that doesn't ...
2
votes
1answer
354 views

How to reject or repulse some points in a 3D cloud of particles?

I'm having an issue with a 3D distribution of points. The distribution is really nicely looking in Mathematica, but it is used in an OpenGL astronomy program (Celestia) to generate a nebula, with ...
2
votes
1answer
182 views

Confusion with SplineFit (Angle calculation)

This question is continuation to this other one I am creating polymers (where each monomer is of equal length) using this method: ...
1
vote
1answer
58 views

Efficient maximisation of log-likelihood

I would like to efficiently find the maximum $(\sigma,\lambda)$ for the log-likelihood of the derived distribution below. I only need $\sigma$ and $\lambda$ to one decimal place - so not very precise. ...
1
vote
0answers
298 views

Developing easy code to apply Delta Method to generate prediction bands for custom distributions

I think that this is an interesting issue for all those who when to not only adjust one prediction function, but also to obtain the prediction bands to asses the graphical or tabular error I'm trying ...
0
votes
2answers
181 views

Fraction of fibers that have failed

I have the following to set into mathematica. Assume a stress(sigma) applied on a specimen which has a number of fibers within it. All fibers that have a strength less than the applied stress should ...
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: ...
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 ...
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: ...
6
votes
1answer
212 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 ...
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, ...
4
votes
1answer
653 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 ...
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
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
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 : ...
5
votes
1answer
715 views

How can we create a histogram distribution from binning data?

HistogramDistribution takes a list of data points, creates a histogram from them, and returns this histogram in a form that can be used as a distribution. I ...
4
votes
2answers
313 views

How to plot an implicit value funtion

Previous question has been solved (Gap in a continuous plot). Here is a new related question. ...
2
votes
1answer
239 views

Compute symbolic Expectation of a summation

I am required to computed following Expectations : $E[\displaystyle\sum\limits_{i=1}^N \frac{X_{i}}{N}] = \bar{x}_{0}$ & $E[\displaystyle(\sum\limits_{i=1}^N \frac{X_{i}}{N})^2] = ...
1
vote
2answers
123 views

Plot Bivariate Data with Marginals

I would like to plot bivariate data along with the marginal distributions. I've arranged the plots in a GraphicsGrid as below but the marginals are centered away from the bivariate plot and I wonder ...
0
votes
1answer
213 views

Better way to plot multiple discrete PDFs?

I often find myself trying to plot multiple PDFs for my courses. I find the default tools available to me are lacking and/or cumbersome. After readings some suggestions here, I have come up with the ...
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. ...
5
votes
0answers
64 views

How to pass a custom method to a particular option?

In an answer to my question More efficient method to compute moments of the Johnson $S_B$ distribution, J. M. has come up with a method to compute the moments of the Johnson $S_B$ distribution, which ...
4
votes
2answers
115 views

Estimate parameters of a derived distribution

I would like to estimate the parameters of a derived distribution fSurvivalGompertzNoiseDist below. This distribution represents simulations from a probability ...
3
votes
3answers
374 views

TransformedDistribution doesn't work

I'm trying to obtain a sum distribution of two discrete random variables. The function TransformedDistribution doesn't work for me in such case: ...
3
votes
2answers
362 views

Calculating the Mean of a Truncated Multinormal Distribution

First, I'm a little disappointed that Mathematica balks at: Mean[TruncatedDistribution[{{0, Infinity}},MultinormalDistribution[{0}, {{1}}]]] Second, is the ...
2
votes
1answer
80 views

Performance of a bootstrap - time of computation not linear with number of iterations

I'm doing a bootstrap based on this thread with the following code (file.txt here): ...
1
vote
1answer
51 views

Custom kernel in CopulaDistribution

Note: I recognize that my question is strongly related to How to define a new copula distribution family, but it seems that there was no clear answer there, and the suggestions given were to simply ...
1
vote
1answer
129 views

Generate a sample from a multivariate Cauchy distribution

I want to generate a random sample from a multivariate Cauchy distribution, however I couldn't find a function for the multivariate Cauchy in Mathematica. I know how to define a distribution in 1D and ...
1
vote
1answer
182 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
223 views

Safe values of $\mu$ and $\sigma$ when randomly sampling from a Log-Normal Distribution?

I believe I'm obtaining overflow errors when randomly sampling from a log-normal distribution with the command: RandomVariate[LogNormalDistribution[μ, σ], 1] ...
0
votes
0answers
43 views

How to obtain the PDF of variable that is square of a Rician distributed variable? [closed]

If a random variable $X$ is Rician distributed with PDF $f_X(x)$ where $$f_X(x)=\frac{2x}{\alpha}\text{exp}\left(\frac{-(x^2+v^2)}{\alpha}\right)I_0\left(\frac{2xv}{\alpha}\right)$$ Then what is ...
0
votes
1answer
220 views

On plotting the Weibull distribution

First: How can I plot the Weibull distribution with parameters a = 2 and b = 3.5 on the range of ...
-1
votes
1answer
334 views

Uniform distribution on unit circle

I need a uniform distribution on the unit circle (x; y) : x^2 + y^2 <= 1 with the density f(x) = (2/Pi) Sqrt[1-x^2] ...