Skip to main content

All Questions

Filter by
Sorted by
Tagged with
4 votes
2 answers
499 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
1 vote
2 answers
173 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 ...
user82859's user avatar
1 vote
2 answers
48 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: ...
Jie Zhu's user avatar
  • 2,295
2 votes
1 answer
204 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 ...
Evan Dodson's user avatar
7 votes
1 answer
127 views

How to calculate a PDF of a neural network output?

I have to find the probability density function of the output of an internal layer in a neural network. I wanted to do it using NetMeasurements adding a layer like <...
user40532's user avatar
  • 215
5 votes
1 answer
175 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 ...
Nima's user avatar
  • 65
1 vote
1 answer
379 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 ...
Davi's user avatar
  • 671
1 vote
2 answers
211 views

FindDistribution doesn't return a decent result

I have the following data set: ...
user avatar
2 votes
1 answer
61 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 ...
user106860's user avatar
0 votes
0 answers
49 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] ...
RENJITH R.V's user avatar
1 vote
2 answers
301 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 ...
An eternal student's user avatar
1 vote
1 answer
108 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 ...
John Smith's user avatar
11 votes
1 answer
490 views

Can LearnDistribution learn conditionality?

I would like to apply LearnDistribution to multivariate conditional distributions. Here's a simple artificial example: ...
M.R.'s user avatar
  • 31.8k
1 vote
0 answers
62 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 ...
Yaroslav Bulatov's user avatar
5 votes
2 answers
334 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 ...
flyingmind's user avatar
1 vote
1 answer
83 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 ...
Tom Rio's user avatar
  • 11
4 votes
1 answer
512 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, ...
Amine Boussoubel's user avatar
1 vote
1 answer
125 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 ...
Yaroslav Bulatov's user avatar
3 votes
1 answer
194 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
78 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
132 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:...
user4933's user avatar
  • 109
4 votes
6 answers
298 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[μ, σ]] ...
yode's user avatar
  • 27.2k
0 votes
1 answer
338 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$?
Jack Wills's user avatar
1 vote
1 answer
162 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 ...
user13465718's user avatar
5 votes
0 answers
403 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 ...
user avatar
2 votes
2 answers
131 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: ...
dvd8000's user avatar
  • 29
0 votes
2 answers
124 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 ...
Gouz's user avatar
  • 291
2 votes
1 answer
335 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: ...
Typeof undefined's user avatar
2 votes
1 answer
76 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 ...
Igor Yegin's user avatar
5 votes
1 answer
128 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 ...
R.Y. Zhao's user avatar
1 vote
2 answers
130 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 ...
Anthill's user avatar
  • 37
2 votes
3 answers
206 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 ...
A Day's user avatar
  • 59
6 votes
2 answers
253 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: ...
user13892's user avatar
  • 9,751
2 votes
1 answer
415 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: ...
user avatar
1 vote
1 answer
265 views

Calculation of an integral which involves distribution of data

I have some data as: ...
user avatar
0 votes
1 answer
93 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 ...
Mreza's user avatar
  • 3
1 vote
0 answers
63 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, ...
Rafegh 's user avatar
2 votes
2 answers
246 views

Fitting Method to generate a gaussian distribution

...
Bora's user avatar
  • 155
0 votes
0 answers
117 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: ...
Kitsune's user avatar
0 votes
1 answer
112 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 ...
user49535's user avatar
  • 1,225
1 vote
2 answers
120 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: ...
SJa's user avatar
  • 113
2 votes
2 answers
167 views

Incorrect results in probability calculation [closed]

By my calculations ...
orome's user avatar
  • 12.9k
3 votes
2 answers
280 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$-...
Penelope Benenati's user avatar
1 vote
1 answer
376 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 ...
MGK's user avatar
  • 565
2 votes
3 answers
523 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? ...
Penelope Benenati's user avatar
2 votes
1 answer
270 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 ...
MarkokraM's user avatar
  • 123
3 votes
1 answer
87 views

Failure in MultinormalDistribution

My RandomVariate fails to evaluate when sampling from a multinormal distribution, any idea what's happening here? This is Mathematica 12.1 on Mac: ...
Yaroslav Bulatov's user avatar
1 vote
0 answers
41 views

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 ...
ciao's user avatar
  • 26k
2 votes
1 answer
136 views

Intepreting the results of DistributionFitTest, and other alternatives in Mathematica 12.1

I have been playing with DistributionFitTest as a means of testing how normal some data sets I have. I've been working with some simulated data sets so I can try ...
user27119's user avatar
  • 2,530
0 votes
2 answers
566 views

How to plot this pdf?

Let $x\sim N(\mu,\sigma^2)$ and $y=\max\{e^{x-1}-\kappa,0\}$. How to get and plot the pdf of y? In particular, there will be a probability mass at $y=0$, which is a nondifferentiable point. I tried <...
RandomBear's user avatar

1
2
3 4 5
11