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)

6
votes
4answers
196 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 ...
1
vote
1answer
37 views

Limit involving DiracDelta gives zero [closed]

Why is the following limit zero? In[147]:= Limit[DiracDelta[ϵ], ϵ -> 0] Out[147]= 0 It does not matter if the limit is taken from either sides (+/-), since ...
5
votes
2answers
103 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 ...
4
votes
1answer
52 views

Gaps in the plot of a cumulative distribution function produced from HistogramDistribution

I have about 200 real numbers spread over the range 0-400. I use HistogramDistribution to bin them and PDF to create the ...
3
votes
3answers
84 views

Working with $X^2$, where $X$ has the uniform distribution in $[-b,b]$

Consider $b>0$ and let $X \sim U[-b,b]$ (the continuous uniform distribution in $[-b,b]$ ). I want to do two computations in Mathematica. First is to compute the density function of $X^2$, which I ...
1
vote
1answer
43 views

Mean of a half-Cauchy distribution

I am trying to calculate the mean (if it exists) of a half-Cauchy distribution. I know that the mean of the a Cauchy is undefined, but I was wondering whether the same is true of a half-Cauchy? (A ...
1
vote
0answers
101 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 can be estimated from the sample mean, ...
8
votes
3answers
286 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: ...
1
vote
1answer
60 views

Boundary parameter in Beta Distribution

I use EasyFit to find the probability distribution of my data. It turns out the data follows BetaDistribution with 0.54022,0.70601 shape parameters and 1.33,6.83 continuous boundary parameters I am ...
0
votes
0answers
41 views

Exploring contours plots of two Binormal distributions

I am facing a little interesting problem. Let´s suppose two binormal distributions, as follows: ...
0
votes
0answers
36 views

Non-existent PDF for combined MixtureDistribution and TransformedDistribution?

I am trying to mix two discrete distributions, one of them shifted by an integer amount by means of TransformedDistribution. When I then try to access the mix, it responds to CDF but not PDF. This ...
4
votes
1answer
115 views

Finding Distribution based on quantile data

I am trying to determine an approximate distribution based on quantile data. I have the following information regarding Profit/Loss from an investing strategy backtest, and I want to use the data to ...
4
votes
1answer
75 views

Proper command to fit a distribution with data incomplete in a known way

Here is my scenario: got some data that I have to fit to a specific parametric family of probability distributions (cannot be changed). Data consist of several bunches of integers between, say, 0 and ...
5
votes
0answers
60 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 ...
15
votes
2answers
254 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. ...
6
votes
2answers
107 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 ...
1
vote
0answers
92 views

Question about Mann-Whitney implementation in Mma

So, I've been doing some statistics using Mma. Typically, the Mann-Whitney U test is used to compare non-normally distributed samples, whose medians are compared if both distributions exhibit similar ...
7
votes
2answers
255 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 ...
1
vote
1answer
66 views

Calculate mean and variance of conditional sum of Gammas

Find $Mean(Z)$ and $Var(Z)$, where: $Z = \begin{cases}W + X_1 & \text{if } W \leq c \\ W + X_2 & \text{if } W > c \end{cases}$ where $\quad W \sim \Gamma(k_0, \theta_0), \quad X_1 \sim ...
5
votes
1answer
160 views

Mathematica function to calculate equivalent NormalDistribution from a WeibullDistribution

I have a WeibullDistribution with mean 12.0 and standard deviation 3.2. Is there any built-in Mathematica function that calculates an equivalent ...
4
votes
1answer
80 views

Overriding a built-in function with custom coded procedures

Sometimes it might be useful to override Mathematica's built-in functions with custom code that is either more specific or more efficient (or even less "smart"), but at the same time keeping the same ...
2
votes
0answers
36 views

How to generate an arbitrary discrete distribution? (EmpiricalDistribution vs ProbabilityDistribution)

I've just started using Mma's distributions. Suppose I want to generate an arbitrary discrete distribution by matching probabilities to outcomes. ...
1
vote
3answers
186 views

Fit dataset with customized discontinuous distribution

I have the following parametric CDF: F[x_, λ_, β_, γ_] = Piecewise[{ {0, x < 0}, {1 - (1 - β) E^(-x λ), 0 <= x < γ }, {1, x >= γ} }]; ...
6
votes
1answer
94 views

RandomVariate of a custom distribution gives only negative points

I don't understand why the following code ...
1
vote
1answer
44 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 ...
7
votes
2answers
113 views

Probability: MultivariateHypergeometricDistribution broken with more than five categories?

dist=MultivariateHypergeometricDistribution[5,ConstantArray[2,10]]; prob=Probability[a==1,Distributed[{a,b,c,d,e,f,g,h,i,j},dist]] We stuff an urn with coloured ...
3
votes
3answers
260 views

What is a good way to display many discrete probability distributions on the same plot in Mathematica?

For something like 2 to 30 distributions each with 2 to 30 values. If we assume the distributions have unique values, a standard stacked bar chart is insufficient, but maybe something similar would ...
5
votes
2answers
130 views

Calculate the mean of ordered distribution of the defined distribution

I am trying to evaluate the mean of the following: Let $a\sim Binom(10,1/2)$ and consider the random variable $\quad \quad d=\left|\frac{2}{\sqrt{10}}a-\sqrt{10}\right|$ Let $d_1,\dots,d_{20}$ be ...
1
vote
1answer
138 views

How to create a vertical (smooth) Histogram on the y-axis of a function graph for an uncertain x?

This is my first time posting a question in StackExchange. I have encountered a certain problem and I can't seem too find a solution. Just a word of caution, I am kind of an amateur when it comes to ...
3
votes
3answers
175 views

How to Plot the PDF of Product of two Normals

I've been looking to plot the distribution of the product of two normally distributed variables, x and y, that are uncorrelated. I've tried symbolically calculating the PDF using the ...
2
votes
0answers
68 views

Detecting discontinuities in derivatives in images

Considering an grey-scale image as a function $z=f(x,y)$. (Specifically, I'm interested in $f=h*h*...*h$, where $h$ is the indicator function of a regular hexagon.) I am interested in finding places ...
4
votes
1answer
112 views

Why doesn't NSolve work for this equality? Wildly incorrect solutions are given in certain cases

I am trying to write a function that solves for p in the following equation: PDF[BinomialDistribution[n, p], x] == op The ...
10
votes
1answer
103 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. ...
13
votes
3answers
168 views
2
votes
2answers
187 views

Can not generate graph using smooth kernel distribution

I am a newbie to Mathematica so this question might looks silly. I want to generate a smooth kernel distribution graph for this set of data. The data I uploaded has two columns, the first column is ...
1
vote
2answers
63 views

Custom multivariate discrete distribution [closed]

This is related to How to define an n-variate empirical distribution function probability for any n? and RandomVariate from 2-dimensional probability distribution but I don't think neither questions ...
4
votes
0answers
152 views

Goodness of Fit of Copula Distribution

I am trying to find out goodness of fit of copula distribution, but Mathematica 10 gives me the same answer for each copula type. e.g ...
3
votes
2answers
142 views

Estimate parameters of AR1 process

I am trying to estimate the parameters of a series $Z_t=W_t^\beta$, where W_t follows an AR1 process with mean 2, $\rho=0.9$ and $\sigma=0.1$: $W_t = \rho W_{t-1} + (1-\rho) \bar{W} + \epsilon_t$ ...
1
vote
1answer
69 views

Defining Probability Distribution with parameters

I have a family of probability distributions, indexed by elements in $\mathcal I =\mathbb N \times [0,1] \times [0,1]$. For each $(A,B,C) \in \mathcal I$ I know how to define the corresponding ...
4
votes
1answer
194 views

How to transform an image into a probability density function?

I'd like to use the Metropolis algorithm to randomly generate points with density according to the brightness of an image. I just need to transform a binary image into a pdf function to use this ...
21
votes
2answers
635 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 ...
7
votes
3answers
190 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 ...
2
votes
1answer
68 views

Plot a product of Beta distributions

I would like to plot the PDF of the product of a $Beta(1,1)$ and $Beta(3/2,1/2)$ random variables. I can use the following to calculate the PDF at a point $x$: ...
10
votes
2answers
162 views

Possible bug in VonMisesDistribution?

Bug introduced in 10.2 or earlier and fixed in 10.3 Observe: ...
4
votes
0answers
88 views

How to define a bivariate skew normal distribution?

There is BinormalDistribution that handles easily bivariate normal distribution and its mixtures. There is also ...
1
vote
0answers
45 views

Mixture of a bivariate distribution defined as a copula

I define a bivariate distribution: ...
0
votes
1answer
41 views

Error message when exporting plot as XLS file

I imported data from excel which has 300 data (which are change in CDS spread). I want to compute corresponding CDF for the data using kernel density estimation. I get the CDF plot but cannt get the ...
0
votes
1answer
75 views

kernel density estimation

I am trying to compute CDF of historical data ( weekly change in CDS spread) using kernel density estimation. The original data has 300 observation. I uploaded data from excel ...
3
votes
1answer
70 views

How should I iteratively refine a MixtureDistribution?

I am trying to find a stopping time for a randomized simulation such that say 95% of trials that will be successful will have already finished. I would like to do this by creating and then refining ...