# 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.

761 questions
Filter by
Sorted by
Tagged with
200 views

### Solving equation over TruncatedDistribution (FindRoot)

I'm trying to solve the following equation : ...
456 views

### How do you generate a random number with a pre-specified probability distribution?

I want to generate a random real number between 0 and 1 but not distributed uniformly but with a probability distribution say, 2 Sin[ pi x ]^2 which integrates to 1 ...
114 views

### How to generate random dots with given distances?

I am interested in the following problem, and am curious if Mathematica could be used to solve it. I start with a radius function $\rho:D\to \mathbf{R}_{\ge 0}$ on a region $D\subseteq \mathbf{R}^n$. ...
1 vote
83 views

### Earth Mover Distance/Wasserstein Distance Of Two Lists

I am in need of calculating the Earth Mover Distance between two one-dimensional discrete distributions with finite support (a.k.a "two lists of identical length whose entries add up to 1"). ...
52 views

### How to find Chi Square and p value?

I want to fit derived distribution on real data using chi square goodness of fit and obtain the values of chi square statistic degrees of freedom and p value for the following data. ...
67 views

### How to find conditional probabilities for simple 4 categories problem?

Imagine you are give the following problem: There is a 50% chance of diagnosing an illness correctly as "Known" instead of "Unknown". There is a 50% that available treatments &...
97 views

### Density of two independent uniform random variables in Mathematica

I've tried the following: d1 = UniformDistribution[{0, W}]; d2 = UniformDistribution[{0, S}]; CDF[d1 + d2, x] But I can't get it to work. I understand that the ...
36 views

### Generate covariance matrix from related random variable distributions

Say I have a random variable $X\sim\mathscr{N}\left(0,\sigma^2\right)$ and another random variable $Y=X+\varepsilon$, where $\varepsilon\sim\mathscr{N}\left(0,\eta^2\right)$ is independent of $X$. I ...
237 views

### Fit function to histogram

I have a list: histx={-56.6335, -57.2327, -57.8607, -57.9682, -57.0061, -57.1872,-56.9209, -56.1284,...}; I managed to create the histogram that I wanted to: But ...
173 views

### Can the CopulaDistributions be fitted?

This is an immediate follow-up to DoAny--which I did consider editing, clarifying and correcting in some respects. But perhaps here I can put the immediate question at hand more directly (the emphasis ...
1 vote
235 views

### Do any of the Mathematica CopulaDistributions (or others) fit well this sampled bivariate copula with uniform marginals over [0,1]?

I'm currently developing a data set that consists of two $50 \times 50$ matrices, which I designate as q1 and Q1. I strongly believe (bordering on formal proof [cf. Corollary 1 in marginalinvariance]) ...
71 views

EDIT-1 This is a minimal example where an error occurs after 44538 samples generated in d1 upon importing as d2. Note that if <...
39 views

### Creating a distribution of random sample means

The following is taken from Chapter 19: Distribution of Random Sample Means from the book: Illuminating Statistical Analysis Using Scenarios and Simulations. Fifty random monkeys, each randomly pick ...
58 views

### Correlation[] returns incorrect result for TransformedDistribution

Here is the code which calculates the Pearson correlation coefficient affect by the Ramp[] function, where c is the general form ...
1 vote
78 views

### A very basic question about weighted data

I have a dataset in the form {{A1,B1,C1,...},{A2,B2,C2,...},...} and the weights in the form {w1,w2,w3,...} Having this ...
1 vote
64 views

### How to generate random points with weight distribution and specific criteria? [duplicate]

Consider some function $f(E_{1},E_{2})$, say $$\tag 1 f(E_{1},E_{2}) = \exp[-E_{1}^{3}+E_{2}^{2}]$$ I want to generate random $n$ points $E_{1}$, $E_{2}$ using this function as weights, with an ...
315 views

### Polynomial fitting to obtain the growth rate

We -- my friend -- had asked a question here, which was not completely related to Mathematica, however, in a hope that someone familiar with the topic could help. There are still some aspects which we ... 49 views

### How to obtain the variance of $\sum_{i=1}^mx_i(x_i+y_i)$ with Mathematica?

I'd like to symbolically calculate the variance of $\sum_{i=1}^mx_i(x_i+y_i)$ with Mathematica, where $x_1, ... x_m$ and $y_1, ... y_m$ are independent, standard normal random variables. In a previous ...
1 vote
109 views

### How to obtain the variance of a chi-squared distribution with Mathematica

I'm new to Mathematica and would like to show that for $x_1, ..., x_k$ independent, standard normal random variables the variance of the sum of their squares, i.e., $var(\sum_{i=1}^kx_k^2)$, is equal ...
37 views

### Issue with "Subscript" and "MatrixPropertyDistribution"

Version: Mathematica 12.2. Using subscripted variables in MatrixPropertyDistribution results in an arcane error. Minimal example: The following works as expected. <...
1 vote
44 views

### KernelMixtureDistribution error message about precision

I want to use KernelMixtureDistribution to deal with a large amount of data points. For example, the following codes shows how I use it: ...
72 views

1 vote
142 views

### 2D kernel density estimation (SmoothKernelDistribution) with bandwidth estimation: what are the values that Mathematica chooses?

Mathematica has built in bandwidth estimation including the rules Scott, SheatherJones and ...
1 vote
178 views

### FindDistribution doesn't return a decent result

I have the following data set: ... 1 vote
53 views

### Are there any issues/best practices/suggestions when working with a DataDistribution instead of a distribution?

Suppose there is a random variable $X$ that can take on values $-1,0,1$, with probabilities $P(X=1)=P(X=-1)=.25$ and $P(X=0)=.5$. How can I work with such a random variable in mathematica? (Find the ...
78 views

### Plot | PDF | UniformDistribution ~ Rookie problem displaying the PDFs

I haven't used Mathematica for some time; and I think, I am having a mental block... All I am trying to do is demonstrate UniformDistribution PDFs for x ~ {0, 1}, {0, 2} and {0, 4} as three seperate ...
46 views

### I have found out CDFs of 2 data and listed them. I need to find out the composition of such 2 CDFs

x= RandomVariate[ExponentialDistribution, 10] y = RandomVariate[ExponentialDistribution, 10] f = EmpiricalDistribution[x] ...
1 vote
240 views

### Any suggestions for improving my fitting?

This is not a completely Mathematica question, but I hope people who are familiar both with Mathematica and statistics could help me on this. I have a set of data as ...
54 views

### Expectation and NExpectation producing different results

I'm looking the the integration problem below, and NExpectation produces signficantly different results from Expectation ...
1 vote
38 views

### Proper probability distribution formatting for DistributionFitTest

I am trying to use an exponentially modified gaussian to fit a distribution, but I think I may be misunderstanding something about how probability distributions work in Mathematica. Running ...
311 views

### Can LearnDistribution learn conditionality?

I would like to apply LearnDistribution to multivariate conditional distributions. Here's a simple artificial example: ...
86 views

### Locking cell groups

Imagine I have a notebook divided into multiple groups of code cells which are set as initialization groups. I then have a single cell which evaluates a function ...
1 vote
50 views

### Implementing approximatePDF function

Sometimes distribution is too complicated for built-in PDF command, so it would be useful to have approximatePDF[dist,x,n] which ...
1 vote
61 views

### Flipping a distribution on the Y-axis i.e. getting the value for -x instead of x

the title says it all: I want to flip a distribution on the y axis (that is evaluating it for the negative of the input compared to the standard case). I want to use this to create a composite or ...
137 views

### Transformation of random variable

I am looking to recreate a derivation of a PDF using a transform of random variables. I did the original derivation in Mathematica with the Mathstatica package, but when I updated Mathematica recently ...
1 vote
29 views

### Ratio involving CDF and PDF of a standard normal random variable behaves unexpected when plotted

Good morning, I am plotting the function $h[x]$, see below, and obtain an oscillating behavior in the range $x \in [7.2,8.3]$ that cannot be explained by the function itself. Also for $x \ge 8.4$ it ...
80 views

### How to make a bar graph like this?

I've read some article recently and because I've been doing the same calculations so far, I wanted to have a graph like this: by the looks of it, it certainly looks like it was done in mathematica, ...
1 vote
73 views

### Sample discrete distributions with a good range of observed entropies

For a numerical sanity check, I need to sample random sequences of $n$ positive numbers adding up to 1, and having a high chance of observing both high entropy and low entropy sequences. Compute the ...
98 views

### How to generate random variate in custom domain for a distribution?

I have a distribution defined in a particular domain of the variable but now I want to generate a random variable not in the entire domain but only in a subset of the domain. Here is what I'm trying ... 97 views

### Dot Density Plot for 3D Probability Density Function of {x, y, z}

I have been calculating probability density functions for different states in the hydrogen atom, and want to plot them in 3D using a dot density plot like this one. However, I have not figured out how ...
76 views

### How to find the appropriate fit?

Imagine we are given this set of data: data = {{0, 1}, {1, 0}, {3, 2}, {5, 4}, {6, 4}, {7, 5}}; We fit the data with: ... 98 views

### Compute the likelihood from pdf : $L= \prod^{n}_{i} p(x_{i})$

I would like to use the product value in order to derive the likelihood. Say we have a Gaussian pdf $p(x_{i})$ for $\{i\}_{i=1}^{n}$ and define the likelihood as $L= \prod^{n}_{i} p(x_{i})$. Example 1:...