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)

3
votes
3answers
143 views

How do I define a two point random variable?

How do I define a random variable $X$ such that $Pr[X=x_1]=p_1$ and $Pr[X=x_2]=p_2$ where the values $x_i$, $i=1,\,2$ are just symbols and the probabilities $p_i$, $i=1,\,2$ are symbolic expressions ...
2
votes
1answer
107 views

Multivariate Exponential Distribution in Mathematica

Is there a way to define a multivariate exponential distribution based on independent univariate exponential distributions (Akin to multinormal distribution): ...
0
votes
0answers
40 views

Key mapping an association applied to a distribution

I am attempting to import data from a database, group it according to a given identification parameter, get it's statistically relevant information, and then export it as a JSON object for ...
0
votes
0answers
24 views

How to get the numerical result of inverse CDF?

This is my code. And I want to solve the function which contains both Q and L. But Mathematica only gives me a result with "InverseCDF" function, but not a number? I'm not sure whether I use the code ...
1
vote
3answers
241 views

How to fit a Distribution to data that already looks like a distribution?

I have a set of data that is already ordered as a distribution. Here is a picture worth 999 words: I tried FindDistributionParameters, and ...
1
vote
2answers
269 views

Generic Matrices

A multivariate Gaussian distribution for $k$ dimensions looks like this: $$\frac{1}{\sqrt{(2\pi)^k|\mathbf \Sigma|}}\mathbf e^{ -\frac 1 2 \mathbf x^T \mathbf \Sigma^{-1}\mathbf x }$$ $\mathbf x$ ...
11
votes
2answers
3k views

What is the best distribution for my histogram?

I defined a security bound for a random walk (cube with 15 length) 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: ...
-1
votes
1answer
192 views

Can Mathematica solve this integral numerically?

I need to evaluate numerically the following $$\int_0^{\infty}\exp\left(-\pi\lambda\mathbb{E}_H\left(\int_r^\infty\left(1-\exp\left(-sP_{\text{M}}Hr^{-1/\delta}\right)\right){\rm{d}}r\right)\right)2\...
0
votes
1answer
39 views

Is it the correct syntax with TransformedDistribution?

I define a function as f[x_] := ...;which is in fact the PDF of a random variable $X$. The PDF if given by $f_X(x)$. Let $Y$ is a random variable, which is the ...
1
vote
2answers
65 views

MMA gives error when a different PDF expression is used for the same distribution

I have the following MMA code. Note that the function I declared at the very beginning is the PDF of square of a Nakagami Distributed random variable. With $m=1$ and $P=1$, $f(h)$ becomes Exponential ...
1
vote
1answer
154 views

How can I evaluate a certain probability density function?

The PDF of a random variable $X$ is given by Note that $H(t)$ is also a function of $x$. Here $-\infty<\mu<\infty$, $\lambda>=0$ and $m>=1/2$ Let $I$ be a function of random variable $Y$....
2
votes
0answers
62 views

Why does Expectation function compute, while explicit integration does not?

The code: Expectation[1 + 1/y, {y \[Distributed] ExponentialDistribution[1]}] outputs 1 - EulerGamma While, ...
1
vote
1answer
46 views

Using distribution of data instead of data in `EstimatedDistribution`

Because of huge amount of data, the data saved in their frequency. for example {1,1,1,1,1,1,2,2,1,2,2,1,1,2,1,2,1,3,24} saved as ...
1
vote
1answer
90 views

package for calculating exponent of power law distribution

There are some packages to fitting power law to empirical date in "R", "matlab", "python" Here with maximum likelihood method As it said here. Does it exist similar package in Mathematica?
0
votes
0answers
138 views

Comparing heavy tailed and non-heavy tailed distribution using Mathematica

I have data from a heavy tailed distribution (see picture 1) and a non-heavy tailed distribution (see picture 2) and want to compare it using a histogram on log-scale. However the picture 3 does not ...
1
vote
1answer
116 views

How to draw a certain PDF

Here Dist is the PDF. I need to draw it. Can someone suggest me a way to do it? ...
1
vote
1answer
193 views

Fitting data to an Normal Inverse Gaussian distribution

I am using data which I suspect is distributed according to the Normal Inverse Gaussian distribution (NIG). The literature says that the 4 parameters of the NIG distribution can be estimated from the ...
6
votes
1answer
199 views

Where can I find the Distributions Palette?

I was watching the "Statistics: Modeling with Statistical Distribution" Training Course and in one of the slides, the following image showed up. Does anybody know if this palette is available and ...
3
votes
2answers
146 views

Transforming a CopulaDistribution only works with the Product Copula

What I want to do: 1) Define a joint distribution function using CopulaDistribution 2) then transform it with TransformedDistribution 3) to get the new Culmulative Distribution Function (CDF). The ...
3
votes
1answer
53 views

TransformedDistribution using integration with parameter doesn't work

I would like to ask for kind help with a following problem using TransformedDistribution in Mathematica. First here is the beginning of the code, that works: ...
1
vote
2answers
73 views

Modeling Gaussian Distribution for 4 Variables

I have 4 random variables A,B,C,D, that all have the same variance $\sigma^2$, but they are independent of each other. What I am trying to find, or to at least approximate, is the standard deviation ...
6
votes
2answers
204 views

How to measure accuracy of prediction distribution?

I have been trying to come op with a way to test if my dataset follows a Poisson distribution. Normally one would use the DistributionFitTest function, but here is ...
1
vote
3answers
79 views

API for defining parametric probability distributions

Mathematica has a lot of machinery for working with predefined probability distributions. It is not clear how to make that machinery work with a new distribution. Suppose I want to define a brand new ...
6
votes
3answers
245 views

Creating a custom distribution with specified skew and kurtosis

Let's say I want to create a simulated sample of returns for a given investing/trading strategy. I know that my strategy is profitable on 64% of trades, that the ratio of mean win / mean loss is 0.72, ...
3
votes
0answers
53 views

PearsonChiSquareTest for count/frequency data?

I read with interest a previous question on the PearsonChiSquareTest from a few years ago, and one answer was very helpful: Performing a chi-square goodness of fit ...
2
votes
1answer
85 views
3
votes
2answers
277 views

Generate a random PDF

How can I generate a random probability density function $p(x)$ in the domain $[0,1]$? Is there a single Mathematica function to do so?
9
votes
3answers
247 views

Deriving a PDF for an annulus distribution

I would like to derive the PDF for an ''annulus'' type distribution, defined by the parameters $\theta\sim U(0,2 \pi)$ and $d\sim N(0,\sigma)$; where $\theta$ is the angle round a circle of radius $r$,...
0
votes
0answers
32 views

Evaluating the cumulative multivariate hypergeometric distribution

Suppose there are 5 black, 10 white, and 15 red marbles in an urn for a total of $N=5+10+15$ marbles. You randomly draw $n=6$ marbles without replacement. The probability that you pick exactly two of ...
9
votes
3answers
187 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 ...
0
votes
1answer
61 views
2
votes
0answers
74 views

The correct assignment of probability distribution to generate random variables

I'm asking you for a help to solve a difficult (for myself) task. Now I will tell you what and why I'm trying to implement. The task is to simulate the passage of elementary particles through a ...
1
vote
2answers
86 views

ContourPlot of HistogramDistribution

I am trying to create a density plot of a 2-dimensional HistogramDistribution. ...
1
vote
2answers
160 views

Why can't Mathematica integrate this PDF?

I'm trying to integrate a transformed Gumbel PDF in Mathematica. Integrate[E^(η*(-(x - q)) - E^((-η)*(x - q))), {x, t, ∞}] However, it doesn't compute. It's fine ...
1
vote
1answer
59 views

How to generate a histogram distribution with height function

According to the Mathematica documentation the HistogramList command allows to specify a height function fh, as third argument, ...
3
votes
2answers
365 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 ...
0
votes
0answers
37 views

Stable numeric integration of multidimensional step function

I am trying to integrate numerically a two-dimensional function (a SmoothKernelDistribution) with a step. I tried a few different settings for the parameters of <...
0
votes
1answer
66 views

Poisson point distribution

The probability of n telephone calls received at an exchange in a time frame (t_i, t_f ) is given by the Poisson point distribution: ...
4
votes
1answer
305 views

Heuristic Method to create low discrepancy sequences

Introduction I am now trying to program an algorithm to achieve an uniform distribution of points within a space of dimension n. I started working in 2D. The idea is to achieve an uniform ...
0
votes
1answer
70 views

How to generate samples from an arbitrary continuous pdf?

If I define an arbitrary pdf p[x_] for a arbitrary-dimensional continuous variable x, how can I use Mathematica to create a function that will return a set of n random samples of x with distribution p?...
2
votes
0answers
90 views

Optimization of custom probability distibutions?

Consider the two tests: Timing[Do[RandomVariate[NormalDistribution[0.5, 0.3]], {200}]] {0.001188, Null} ...
6
votes
1answer
71 views

Bug (or missed opportunity) in MarginalDistribution?

Observe: dist = MultivariateHypergeometricDistribution[k, Range@5]; Tr@Range@5 MarginalDistribution[dist, {1}] MarginalDistribution[dist, {1, 2}] First@% 15 ...
10
votes
2answers
139 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. ...
1
vote
1answer
42 views

Difference between two usages of TransformedDistribution

I am modeling the distribution of the sum of two dice throws as a TransformedDistribution ...
4
votes
1answer
121 views

PDF of product of two random variable with PDFs involving Dirac-delta function

I am trying to find the PDF of product of two random variables with the following distributions, ...
3
votes
2answers
145 views

Fast way to evaluate the PDF of a multivariable distribution

I'm trying to evaluate the PDF of a truncated multi-normal distribution. My distribution has 8 dimensions and each value must be ≥ 0. ...
-1
votes
1answer
85 views

Draw independent samples from conditional distribution at a fast rate

I would like to draw samples from the following conditional distribution of the following (don't ask why): ...
12
votes
2answers
303 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)$ ...
0
votes
0answers
84 views

Maximum Likelihood Estimation of Gamma-distribution Scale parameter

I have the following tasks: Generate random sample with given parameters shape = 2, scale = 0.001 and shape = 2, scale = 1/1200 for the right censored sample; Using Maximum Likelihood Method ...