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

723 questions
Filter by
Sorted by
Tagged with
68 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 ...
42 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 ...
54 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 ...
98 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 ...
24 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 ...
72 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, ...
68 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 ...
75 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 ...
43 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 ...
74 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: ...
91 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:...
125 views

### Determining Mean Path Length

I'm interested in working out the average path length in a square. Assume at a single point within the square, photons are released in every direction. I'm interested in determining the average path ...
223 views

### How can we use TransformedDistribution to infer the sampling distribution of the sample mean?

As we know, TransformedDistribution can infer a distribution of a transformation like TransformedDistribution[A*X + B, X \[Distributed] NormalDistribution[μ, σ]] ...
89 views

### Symbolic Mean and Variance Calculations

I need a tutorial that gets me started on basic symbolic calculations with random variables. My naive attempts did not get me far. ...
23 views

### Use the plot information as an input in some math calculations

If i want to have X and y axis numbers in matrix to use them for math calculation how should I do it here? If I had ...
105 views

### Sketching a PDF function (discrete)

I have this distribution: $Probability = 2/(\operatorname{cosech⁡}(x))(k x^{2k}))/((2k))$ for $k$ = 1 to infinity. How can I do a sketch for any value of $x$?
95 views

### PDF of sum of (1/(1+uniform distribution)) and a normal distribution

I have a continuous uniform random variable $P∼U(0,1)$ and a normal random variable $X∼N(0,σ)$. If $Z$ is given by $Z=\frac{1}{1+P}+X$ where $X$ and $P$ are independent variables, how can I calculate ...
295 views

### Histogram (automatic binning)

There are different methods for choosing widths of bins for a histogram, like Freedman-Diaconis rule. In Mathematica, without choosing a specific method, with the command ...
104 views

### Mathematica can't seem to handle Truncated BinormalDistribution when there is non-zero correlation coefficient

I would like to use Mathematica to analyze (e.g., compute moments, plot, etc) a truncated bivariate normal distribution. For example: ...
31 views

### Normalize an L(s, d) function for fixed s

I have the following function L: σ = 9; L[s_, d_] = (1/(σ*Sqrt[2*\[Pi]]))*E^(-(1/2)*((s-(-50-11*Log[d]))/σ)^2) This function L describes basically for some ...
42 views

### CDF function from list

How can I get the CDF for a list of values ​​containing the value of a random variable and its probability? I have: ...
52 views

### How to find sum of squares of data from a multivariate (Dirichlet) distribution? [closed]

Let $X = Dirichlet(1,1,1)$ be a tri-variate random variable with Dirichlet distribution with parameters all equal to 1. I need to find what $X_1^2+X_2^2+X_3^2$ will be. I did ...
55 views

### Plot with three functions and three parameters [closed]

I think my code doesn't have any problem but the program shows me this error and I'm confused! Plot::argr: Plot called with 1 argument; 2 arguments are expected. ...
90 views

### Is there any way to compile and export LearnedDistribution?

I use the LearnDistribution function to learn the distribution of some data. Then, I want to export some code to sample from that learned distribution. I tried to use Compile as follows ...
104 views

### Mean of TransformedDistribution returns wrong result

I want to compute the mean of this transformed distribution $10^{(25+5x+y)/5}$, where $x$ and $y$ are independent normal random variables. Here is my code ...
73 views

### TransformedDistribution not returning a function

I'm trying to use TransformedDistribution to find the distribution of a function of two variables that have Normal distributions. The function is $h(x, y)=x^2+y^2$. I tried to do this two ways, first ...
37 views

### Probability in a given distribution

I have the following distribution: a=0.215775; b=1.76885; c=2.28023; edistT=StudentTDistribution[a,b,c] I would like to calculate, numerically, the value, ...
113 views

### Chen weibull distribution

I write the density function of cw distribution and add data to calculate parameters maximum likelihood but the results of Mathematica no like the research ...
37 views

### Derivative of an expectation function

For a general function $g$, define $f=\mathbb{E}_{(x,y)\sim \mathcal{N}(0, \Sigma)}[g(x)g(y)]$, where $\Sigma=\begin{pmatrix}a & c \\c & b \end{pmatrix}$, and $a>0,b>0,ab>c^2$. I am ...
198 views

### Why is the conditional probability not working for CategoricalDistribution?

Bug introduced in 12.1 and fixed in 12.3 Consider the following simple example for demonstration: ...
154 views

### Entropy of a distribution

I need to calculate the entropy of a distribution from raw data. I found two approaches here and here. But it seems they don't work for my case. My data is: ...
64 views

### Calculation of an integral which involves distribution of data

I have some data as: ...
57 views

### Skewness and central moment

I have distribution which I want to calculate the third order moment function of my distribution. I got confused what is different between Moment third order and ...
37 views

### Create CDF from a custom function

I have a complex function as follows (sorry for ugly script due to many parameters in the code!) which gives CDF of some data. I wonder whether there's any way to write it in CDF form in Mathematica, ...
132 views

...
46 views

### How to go from a Pareto Distribution in Scipy to a Pareto Distribution in Mathematica?

Assume that I have fitted a Pareto distribution via Scipy and have gotten the following parameters: ...
69 views

### Evaluation points following a bivariate Gaussian distribution [closed]

I have a function of two variables, say $f(a, b)$, which I want to evaluate (and later average) in the neighborhood of $a=0$ and $b=0$, with density of points around $(a,\,b)$ following a Gaussian ...
107 views

### Expectation with conditional random variable [closed]

Given an Exponentially Distributed Random Variable $X\sim \exp(1)$, I need to find $\mathbb{E}[P_v]$ in Mathematica, where $P_v$ is given as: ...
121 views

157 views

### Incorrect results in probability calculation [closed]

By my calculations ...
184 views

### Maximum of all distances between any pairs of vertices of a random triangle

Given a set $S_n$ of $n$ points selected uniformly at random in a $d$-ball, I want to estimate the average length of the longest side of a triangle having as vertices any three distinct points of $S_n$...
111 views

### Estimation of the expected Euclidean distance between two random points on a unit $n$-hemisphere

What is the best approach to estimate, with Wolfram Mathematica, the expected Euclidean distance (in a $(n+1)$-dimensional space) between two points selected uniformly at random on a unit $n$-...
89 views

### How to find the inverse of CDF of geometric function? [closed]

The cdf of geometric distribution is given by $F(x)=1-(1-p)^x$. I want to calculate the inverse of it, for example, $F^{-1}(U)$ I am doing the following ...
147 views

### Estimate the expected distance between two random points on the unit $n$-sphere [duplicate]

What is the best approach to estimate, with Wolfram Mathematica, the expected Euclidean distance in a $(n+1)$-dimensional space between two points selected uniformly at random on the unit $n$-sphere? ...
82 views

### Does mathematica have support for mixture models?

Does Mathematica have support mixture models? Similar to the R language libraries mclust or ...
128 views

### Extracting the component distribution parameters from a mixed-normal distribution (for n > 2 normal)

I'm trying to extract the distribution parameters of the sub-distributions which comprise a mixed normal distribution. I'll give my attempts so far. First the simulated data: ...
154 views

### Raising the normal distribution curve to a specified height on the $y$-axis

I'd like to know how to fit the normal distribution curve between $x$ and $y$ values so that the curve maintains its bell shape. I guessed the sigma is the scale ratio, but it doesn't work as I ...
### Speed up exact distribution of the sum of the top $k$ statistics on a bounded discrete uniform distribution?
I came across a nice answer by Sasha (I believe a Wolfram engineer) on mathematics stack exchange regarding the distribution of the sum of the top $k$ order statistics. (This was an answer to an RPG ...