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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
13 views

Definite Integral of Probability Distributions

Suppose at each value of $x$ I define a normal distribution dist[x_] := NormalDistribution[Sin[4 x], Cos[10 x]^2] Now I want to find the distribution $$ \mathcal{D}...
user avatar
0 votes
0 answers
54 views

Settings that integrate gives also distributions as solutions

How can I tell Mathematica that I also want distributions as solutions for Integrate? Example: $$\int_{\mathbb{R}} \mathrm{e}^{\mathrm{i}kx}\mathrm{d}x=2\pi\delta(x)$$
user avatar
  • 101
5 votes
4 answers
200 views

Solving equation over TruncatedDistribution (FindRoot)

I'm trying to solve the following equation : ...
user avatar
5 votes
2 answers
457 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 ...
user avatar
0 votes
2 answers
115 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$. ...
user avatar
1 vote
1 answer
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"). ...
user avatar
  • 283
0 votes
1 answer
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. ...
user avatar
2 votes
1 answer
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 &...
user avatar
  • 856
3 votes
1 answer
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 ...
user avatar
  • 33
2 votes
1 answer
37 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 ...
user avatar
5 votes
2 answers
238 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 ...
user avatar
2 votes
2 answers
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 ...
user avatar
1 vote
3 answers
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]) ...
user avatar
0 votes
1 answer
71 views

Is there a difference between generating and loading data?

EDIT-1 This is a minimal example where an error occurs after 44538 samples generated in d1 upon importing as d2. Note that if <...
user avatar
2 votes
0 answers
40 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 ...
user avatar
2 votes
0 answers
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 ...
user avatar
1 vote
1 answer
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 ...
user avatar
  • 3,542
1 vote
0 answers
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 ...
user avatar
  • 3,542
4 votes
2 answers
316 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 ...
user avatar
0 votes
0 answers
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 ...
user avatar
1 vote
2 answers
110 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 ...
user avatar
0 votes
0 answers
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. <...
user avatar
1 vote
2 answers
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: ...
user avatar
  • 463
2 votes
1 answer
74 views

Finding distribution of sum of two dependent variables

I am trying to find the distribution of the sum of two random variables $(x_1,x_2)$ which have the following distribution: $$f(x_1,x_2) = \begin{cases}2 ( x_1 + x_2) & 0 \le x_1 \le x_2 \le 1 \\ 0 ...
user avatar
1 vote
1 answer
53 views

Getting samples out of a given distribution

I get an error in mathematica when i try to get 10 samples of a MultinormalDistribution with: ...
user avatar
  • 31
1 vote
1 answer
49 views

Drawing samples from MulitnormalDistribution

I have a question concerning generating samples for a given mean vector and covariance matrix. ...
user avatar
  • 223
0 votes
2 answers
116 views

How to fit a skewed normal to the data and obtain the corresponding parameters? [closed]

I have: data = {0.00677966, 0.0677966, 0.335593, 0.308475, 0.213559, 0.0440678, 0.0237288} Although, the normal fit to the data is not bad: ...
user avatar
  • 1
0 votes
0 answers
25 views

Is there a general unifying formula for the Laplace transform of a general weibull density?

It seems that the Laplace transform of weibull density has different formulas for rational shape parameters, depending on the degree of the numerator/denominator https://idp.springer.com/authorize/...
user avatar
  • 896
5 votes
1 answer
128 views

What is the default binning method of Histogram[]?

Histogram[] command returns a histogram of a set of data. There are different methods of binning, such as, Scott's rule, which we can specify the binning method in Mathematica. My question is what is ...
user avatar
  • 65
0 votes
1 answer
58 views

Stationary Distribution of Markov Chain [closed]

I'm trying to compute the stationary distribution of the following Markov chain: $$P=\left( \begin{array}{cc} p_{11} & p_{12} \\ p_{21} & p_{22} \\ \end{array} \right)$$ I know you have to ...
user avatar
  • 341
1 vote
1 answer
143 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 ...
user avatar
  • 641
1 vote
2 answers
179 views

FindDistribution doesn't return a decent result

I have the following data set: ...
user avatar
1 vote
1 answer
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 ...
user avatar
2 votes
1 answer
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 ...
user avatar
  • 5,719
0 votes
0 answers
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[2], 10] y = RandomVariate[ExponentialDistribution[3], 10] f = EmpiricalDistribution[x] ...
user avatar
1 vote
2 answers
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 ...
user avatar
2 votes
0 answers
54 views

`Expectation` and `NExpectation` producing different results

I'm looking the the integration problem below, and NExpectation produces signficantly different results from Expectation ...
user avatar
1 vote
1 answer
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 ...
user avatar
8 votes
1 answer
311 views

Can LearnDistribution learn conditionality?

I would like to apply LearnDistribution to multivariate conditional distributions. Here's a simple artificial example: ...
user avatar
  • 30.3k
5 votes
1 answer
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 ...
user avatar
  • 4,138
1 vote
0 answers
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 ...
user avatar
1 vote
2 answers
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 ...
user avatar
  • 13
2 votes
2 answers
140 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 ...
user avatar
1 vote
1 answer
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 ...
user avatar
4 votes
1 answer
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, ...
user avatar
1 vote
1 answer
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 ...
user avatar
2 votes
1 answer
99 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 ...
user avatar
0 votes
0 answers
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 ...
user avatar
0 votes
0 answers
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: ...
user avatar
-1 votes
1 answer
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:...
user avatar
  • 109

1
2 3 4 5
16