Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [distributions]

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

4
votes
2answers
118 views

Problem with TransformedDistribution

I am trying to use Mathematica to obtain the probability distribution of $\frac{1}{2}(A + B)$ where $A$ and $B$ are independent random variables each distributed according to the uniform distribution, ...
1
vote
1answer
29 views

Impose conditions on PDF distribution

Consider some data data = {{x1,y1},{x2,y2},...} I organize a density distribution using ...
0
votes
2answers
71 views

How to plot a single plot with two variables

guys. Suppose I have this equation: M(t) = Meq + (M0 - Meq) exp[-t/τ] where t denotes de time, Meq and M0 defined parameters and τ is an another defined parameter. I can easily plot this equation (...
4
votes
2answers
67 views

ProbabilityDistribution with variable number of dimensions

I would like to construct a ProbabilityDistribution with a variable number of dimensions. I tried to use $Assumptions = x ∈ Vectors[d, Reals] so that the variable <...
3
votes
2answers
531 views

How can find the 2D Voronoi cell area distribution?

I need to find the area distribution function of the 2D Voronoi cells in Mathematica version 11 and later. My old instructions for Mathematica 9 don't work anymore. How can I do it?
4
votes
1answer
100 views

Smooth Density Histogram with probability areas

As an example, for a normal distribution everyone knows that 68% will fall within one standard deviation away from the center and so on. The following code will give me a 2D Normal distribution and ...
3
votes
3answers
389 views

How would you visualize a multivariate Gaussian in high dimension (>3D)?

Obviously, I can't do: Plot3D[PDF[ MultinormalDistribution[{0, 0, 0}, {{1, 0, 0}, {0, 1, 0} {0, 0, 1}}], {x, y}], {x, -20, 20}, {y, -20, 20}] How would ...
0
votes
1answer
49 views

Create Poisson distribution

I would like to make a phone call at the average arrival rate of λ = 300 [call / minute] per minute in the Poisson distribution of the telephone exchange and save it on the list. I don't know even if ...
0
votes
1answer
42 views

Conditional expectation using derived distribution [closed]

While this question can be solved using some (hand) analysis and standard calculus, I would have thought that the following code would have worked: ...
0
votes
1answer
126 views

How to use Mathematica's Moment Generating Function?

Given the following p.d.f., which is the p.d.f. of the ratio between a complex Gaussian and a Chi-squared RVs: \begin{equation*} f_U(u)=\exp\Big\{{-\frac{1}{4 u^2}}\Big\} \,\frac{\left(8 n u^2-1\...
19
votes
5answers
1k views

Sisyphus Random Walk

A Sisyphus Random Walk evolves as follows: With probability (r) you advance the position of the walker by +1. With probability (1-r) the walker resets at x0 = 0. To simulate the probability of reset ...
7
votes
5answers
1k views

Survival Probability for Random Walks

The Survival Probability for a walker starting at the origin is defined as the probability that the walker stays positive through n steps. Thanks to the Sparre-Andersen Theorem I know this PDF is ...
8
votes
2answers
232 views

Overloading functions like Mean for distributions

I'd like to understand how functions like Mean are overloaded to provide the right behavior for the distributions in Mathematica (like NormalDistribution or PoissonDistribution). I originally assumed ...
16
votes
1answer
206 views

Possible bug in OrderDistribution? [Update: Confirmed by Wolfram Research and enqueued.]

Bug Introduced in 11.3 or earlier Observe: ...
3
votes
3answers
111 views

Efficient function for life duration probability?

Sent to me by a colleague asking me for assistance (the function as is breaks): ...
0
votes
1answer
56 views
0
votes
1answer
80 views

Mathematica failing to compute function to calculate integral over a region bounded by straight line

Statement of the problem Consider the following situation: You have a model which employs a bivariate distribution with known parameters. You have a random realization from the distribution ...
1
vote
2answers
105 views

Sampling data from numerical values of density distribution of nucleons

How could i sample my data which follows distribution if i have only numerical values of density distribution as an example data attached as in picture I tried but do not know how to do it. The data:...
0
votes
2answers
84 views

Finding area under a PDF

Suppose I have a PDF with mean a and standard deviation b defined as below. How would I go ...
1
vote
1answer
59 views

Computing the PDF of a WishartMatrixDistribution. Is this a limitation in the PDF Mathematica function?

I'm trying to compute the pdf of a wishart distribution. Why does PDF[WishartMatrixDistribution[10, IdentityMatrix[4]], 2*IdentityMatrix[4]] not return a ...
0
votes
0answers
50 views

CDF of probability from a ClassifierFunction

I have a classifier function that classifies whether a student is likely to succeed in a course given their score on a placement test. From this, I am pulling both the probability of being successful ...
1
vote
1answer
48 views

How to pass starting values in matrix form?

Consider the following MWE, where I try to pass starting values to FindDistributionParameters[]: ...
1
vote
1answer
94 views

Finding the optimal probabilty distribution

I am trying to obtain the optimal probability distribution function to the following data. My attempt: ...
0
votes
2answers
53 views

Partitioning Mixture Distribution Dataset into constituent Distributions

Suppose I have a dataset that is derived from a random sampling from a mixture distribution ...
-1
votes
1answer
32 views

Is there a workaround for this Solve and NSolve error?

Using either Solve or NSolve gives the same error: ...
0
votes
0answers
29 views

How to solve when using a Cumulative Binomial Distribution function?

This is probably very simple, but I could not find the answer. How to solve? I tried Reduce as well to no avail. ...
0
votes
1answer
77 views

Model fitting for concave curve: test if asymptote or convergence exist

I am asking a double check if conceptually I set up proper model and proceeding in good direction to drive conclusions. I have a distribution that looks like this: I want to test if for increasing x ...
4
votes
2answers
86 views

Why does the PearsonChiSquare from FindDistribution and DistributionFitTest differ by a factor of $10^{20}$?

This is similar to the unanswered "Why the results of FindDistribution and DistributionFitTest are not consistent?" My more specific question is: Why do the PearsonChiSquare values for ...
0
votes
2answers
84 views

How to speed up this calculation regarding the normal distribution?

This calculation takes a very long time! Why? How can I improve it? Thanks! ...
2
votes
1answer
58 views

Drawing random numbers from TransformedDistribution

Suppose I have created the following TransformedDistribution: ...
0
votes
1answer
62 views

Producing a probability distribution numerically

Given that Mathematica could not produce a symbolic solution to the problem stated here, how can I produce many values of $A$ to then create $B$ numerically? ...
0
votes
2answers
104 views

Is this TransformedDistribution beyond Mathematica?

Creating the following transformed distribution $A$ A = TransformedDistribution[Sqrt[x^2], x \[Distributed] NormalDistribution[\[Mu], \[Sigma]]] and then using A ...
0
votes
0answers
54 views

Random points from an image using a BernoulliDistribution

I am a Mathematica newbie. I need to sample random points from an image which I have stored in a variable img as: ...
7
votes
2answers
331 views

Calculate mean normed distance and normed variance of cone-shaped distribution in N-dimensions

I would like to calculate the mean and variance of the normed distance of a cone-shaped distribution, $f(x) \propto \exp(-|x|)$, where $x\in\mathbb{R}^d$, where $d$ can be any positive integer. In ...
0
votes
1answer
58 views

Negative values with RandomVariate

I am using the following code to generate some random number from a custom distribution: ...
5
votes
2answers
129 views

Integrating a bivariate distribution over a region bounded by a straight line

Summary of problem: I'm using Mathematica version 8 to try to integrate the bivariate distribution over a region bounded by a straight line. The two random variables are uncorrelated. When I use ...
3
votes
3answers
46 views

Double differential distribution using set of data

Consider a set of data having the form $\{\{x_{1}, y_{1}\}, …,\{x_{n},y_{n}\}\}$. Each point from the set corresponds to 1 event with coordinate $x, y$. I'm looking for a procedure in Mathematica that ...
3
votes
2answers
105 views

How to apply assumptions to parameters for FindDistributionParameters?

Say I have data that I want to fit to a distribution while applying assumptions on one or more of the parameters. For example, for ParetoDistribution[k, α, μ] <...
4
votes
3answers
155 views

Construct Distribution Histogram From Random Variable

Given a Beta Random Variable $X$ with parameters $\alpha, \beta$ and a positive constant $n$, suppose I am interested in the distribution of: $$Y:=\lfloor nX\rfloor$$ Suppose I want a histogram ...
10
votes
3answers
587 views

Can I use Compile to speed up InverseCDF?

I'm repeatedly issuing the command P = InverseCDF[NormalDistribution[0, 1], T] where T is either a 36- or 64-vector of real numbers (points in the unit ...
0
votes
1answer
40 views

ProbabilityDistribution fails for square root

I would like to sampling data from a distribution Sqrt[x^2 + y^2]. I used the code as follows: ...
0
votes
2answers
43 views

Linear Combination of Normal Distributions

I'm just playing around with RandomVariate. Right now I can't really figure out why a linear combination with weights 0.5 of two identical normal distributions is not yielding the same distribution. 0....
0
votes
1answer
47 views

Arbitrary conditional multivariate expectation

I am interested in finding a conditional expectation of a multivariate Normal distribution. For example, let $X$ and $Y$ denote two random variables with a joint normal distribution. Let $X \sim N(\...
3
votes
2answers
60 views

Scale maximum width of distributions in DistributionChart proportional to sample size?

I am looking to compare three different distributions by making a chart with the three violin plots via DistributionChart. The distributions have different sample ...
0
votes
0answers
26 views

Check if some Intervals are evenly spread across a Timeline

I currently have the problem that I need to compute some characteristic number (would be good if its in 0-1 range) for the "evenness" of event starts. I have various Timeslots which consist of a ...
3
votes
1answer
137 views

Log transformed histogram distribution

Bug introduced in 11.0.1 or earlier and persisting through 11.3.0 or later I try to get a Log transformed histogram data I get from a different program ...
3
votes
1answer
62 views

How can Distribution fitting be sped up?

The first line generates 1050 data points to fit. The second line fits this data to the same distribution. This takes about 100ms on my computer. Doing this with ...
7
votes
2answers
1k views

Can this code be changed to run faster?

I've worked for several days trying to get this code to run faster. The imported data is 15MB. ...
1
vote
0answers
48 views

Why is this parallel notebook not maxing out the available memory and processors?

I've searched many questions about parallel processing here, and they are either specialized or over my head. I run the following parallel notebook on an 8 core EC2 instance. The average memory usage ...