# Questions tagged [probability-or-statistics]

Questions about systematic data collection and organization, or the application of probability theory to model the inherent patterns and properties of sampled data, underlying data distribution(s) or random processes.

1,852 questions
Filter by
Sorted by
Tagged with
213 views
+300

### Nearest-neighbor density estimation in Mathematica

I want to use SmoothHistogram-like plot using smoothing kernel $f(x)$ which is uniform $(a,b)$ with $a,b$ adjusted for each $x$ to include 11 points on the left, ...
1 vote
52 views

Given that the initial area in a Sierpinski triangle is A_0 and the subsequent areas $$(A_n) =A_0 (3/4)^n$$ , what is the formula to calculate the leading ...
91 views

### Bandwidth selection for histograms in bounded domain?

Does anyone have tips how to do proper bandwidth selection to visualize density which is known to be strictly positive? Example below uses SmoothHistogram and ...
122 views

### One more incorrect result of CDF

In 13.3.1 on Windows 10 I find ...
229 views

### An incorrect result of CDF

In 13.3.1 on Windows 10 I execute ...
69 views

### Any luck estimating a multivariate hidden Markov process?

I am having problems using EstimatedProcess to estimate a multivariate HiddenMarkovProcess. I'm following the work of a paper, so I know this method is feasible. In brief, given 2 economic variables: ...
103 views

### Fast multivariate Cauchy sampling?

I've been using the code below to efficiently sample from multivariate Gaussian with diagonal covariance matrix. Now I want to try the same for Cauchy samples, however replacing ...
339 views

### Sampling from intersection of $n$-sphere and hyperplane

Edit How do I uniformly sample from intersection of $n$-sphere centered at 0 and an arbitrary hyperplane for $n\ge3$? Below is an approach using FindInstance to ...
108 views

### How to calculate the Poisson index of dispersion? [closed]

I came across the Poisson index of dispersion. I find it very interesting. But I didn't understand how to apply it. It is simply necessary: ...
70 views

### Gamma Distribution: what to do after calculating Shape and Rate? How to proceed? [closed]

I got stuck while applying Gamma Distribution. Having Mean = 5 and Standard Deviation = 2, here's how I preceded: ...
1 vote
92 views

### How can we plot horizontal prediction bands?

1. Problem statement Some game days before the end of a league season I want to show the possible final rankings (depending upon the results of the outstanding games). 2. Example data (situation after ...
174 views

### CorrelationTest vs PearsonCorrelationTest

I understand that these two functions consider different null hypotheses. However, although I can reproduce the calculation related to PearsonCorrelationTest from scratch, I cannot reproduce the p-...
63 views

### A geometric application of Benford's law [duplicate]

I would like some help solving the following problem using Mathematica: Show that, no matter what the initial area of an equilateral triangle is, the sequence of areas (painted in black) of the ...
189 views

### Sort sequences by their "randomness"

Example matrix (rows always have equal lengths) ...
1 vote
116 views

### Compute Central Moments of Vector

Say we have three stochastic variables defined as follows: ...
390 views

### An accumulated moving average

1. Problem statement In accordance with the standard definitions the inbuilt MovingAverage ...
1k views

### Problem on geometric probability

This is a problem from the recent 18th Kolmogorov competition on probability theory and statistics 2023. A random point P is chosen in an equilateral triangle. What ...
1 vote
99 views

### Pick random value based on list of probabilities

I'm pretty sure this must have been asked before, but I can not find the duplicate. Given a list of values with their probabilities ...
39 views

### CompiledFunction fails for Variance with a rank 3 input

Why does compiling Variance for a rank 3 input fail but Mean works? ...
58 views

### Function to generate analytic solution of StandardDeviation of a list given sublists

Motivation I have the Mean and StandardDeviation of several lists of equal size but I don't know the elements of those lists. I ...
59 views

### Modifying horizontal axis of a PDF plot

I have a bunch of particles that I can measure their volume. PDFs of the size distribution by volume of particles, v(a), measured are reasonably well represented by lognormal distributions of the ...
71 views

### How can I calculate P-Value for a custom distribution?

I used DistributionFitTest but it works only with a defined distribution. This is the distribution that I used: ...
102 views

### Optimization of a Markov сhain with symbolic transition rate

I am trying to work on 1D random walk that can move to left, right or stay with probabilities $p_i$,$q_i$,$r_i$ that changes with the site $i$. I am trying to simulate this by using a recurrence ...
334 views

### How to select elements from a list using another list

I have two lists: list1 and list2: ...
40 views

### Trying to use ProbabilityDistribution for custom distribution - Getting errors/warnings I don't understand

I have this custom distribution that I want to use in Mathematica, but there appears to be some sort of problem I don't understand. Also, when I compute the mean for the custom distribution via ...
404 views

### Visualizing empirical PDF from monotonically decreasing density

I have a sample from distribution whose density is known to be monotonically decreasing. What's the easiest way to incorporate this information into Mathematica for an empirical density plot? Looking ...
53 views

### Obtaining moments from the *inverse* of the moment-generating function?

I have a moment generating function $z=\phi(t)$ whose inverse has the following form for integer $k>0$ $$t=\frac{z}{(1+z)^{k+1}}$$ How would I get the moments? Code below uses ...
97 views

### Unable to check own distribution

Good afternoon I need to estimate different distributions from some data. Among these distributions, it is necessary to use the Kritsky-Menkel distribution. I set a formula for the distribution ...
1 vote
79 views

### Getting behavior around 0 for spectrum of product of Gaussian matrices?

Edit the math part was answered in mathoverflow, I'm now looking on how to port this to Mathematica to check against observed fit Consider a product of $k$ independent square matrices with IID ...
206 views

### Second Order Probability

The literature has considerable discussion of higher order probabilities and in particular second-order probability, which is the probability that the true probability of something has the value P. ...
69 views

### Identifying $X^2$ relationships between random variables

Given $X$ coming from a known distribution faily, how do I identify distribution family of of $X^2$ and $\sqrt{X}$? Code below uses ...
59 views

### Fitting data to peaks visually with manipulate - how to compactly implement for many peaks

I am trying to create a visual aid for peak fitting. There should be a background profile and on top, I want to place peaks. So far, I am stuck with the following issue. For simplicity, I am using a ...
117 views

### FindPeaks in a 2d list and half values

FindPeaks is a nice little help. But it only works on 1D lists and tends to return half integer values for positions of the peaks which are ultimately very useless ...
85 views

### Grouping expressions by their $O(..)$ rate of growth around 0

Given a list of expressions like $3 x^2,\frac{\sqrt{x}}{\sqrt{2}},\frac{2 \sqrt{x}}{\pi },\frac{9 x^3}{2},x,$, how could I group them based on their rates of growth around 0? IE, $2x$ and $3x$ are ...
1 vote
118 views

### Sampling from density specified in terms of spacing ratios?

Given a sorted vector of positive reals $\{\lambda_1,\lambda_2,\ldots,\lambda_P\}$ and corresponding vector of spacing ratios $r_i=\frac{\lambda_i-\lambda_{i-1}}{\lambda_{i-1}-\lambda_{i-2}}$, I know ...
174 views

### How to Draw a Probability Tree Diagram to Calculate the Probability of Badminton Competition Game?

Question： A, B, and C students will participate in a badminton competition, and the agreed format is as follows: Those who have accumulated two losses are eliminated; Draw lots before the competition ...
160 views

### Can the type 3 SS be obtained using the ANOVA function or an adaptation that is readily available in Mathematica?

The default output for the ANOVA function is that of a type 1 Sum of Squares (SS) table. This is sufficient for a one-way ANOVA, however, when running an n-way ANOVA (with n greater than 1) and ...
1 vote
81 views

### Visualizing range of possible CDFs of $X\in (0,1]$ such that $E[X]=1/3$

What's an elegant way to visualize the range of possible CDFs for a random variable $X\in (0,1]$ such that $E[X]=\frac{1}{3}$? Below is an attempt by discretizing (0,1] interval and using ...
121 views

### Calculating Distributions that Have Dependencies

I want to calculate a distribution from a function that depends on several variables, where there is an interdependency between the variables. This works: ...
140 views

### Visualizing density given by its Stieltjes transformation?

How can I use Mathematica to get $f(y)$, the PDF of a random variable given its Stieltjes transform $g(s)$? $$g(s)=E\left[1/(s-X)\right]$$ I need to visualize probability density of a random variable ...
1 vote
206 views

### Finding a continuous distribution that fits the empirical density of dataset $1,1/4,1/9,1/16\ldots$

I have a list of coefs of the form $1,1/4,1/9,1/16,\ldots,1/d^2$ sampled with relative sampling frequencies $1,1/4,1/9,1/16,\ldots,1/d^2$. How do I find a nice continuous density whose CDF closely ...
62 views

### MomentGeneratingFunction producing a function with negative moments

I'm getting moment generating function which is negative and all moments are $-\infty$ which seems wrong...1) is this a bug in MomentGeneratingFunction? 2) what is ...
155 views

### Getting distribution of squared coordinate on a sphere?

Suppose $\mathbf{x}$ is on a surface of n-sphere, how do I get the distribution of $x_1^2$? Distribution of $x_1$ is shifted Beta so we can use ...
1 vote
75 views

### Deriving variance component of 1-Way ANOVA?

My goal is to drive $E(MSA)$ for this design(the 1-way ANOVA); $$y_{ij}=\mu +\alpha_i + \epsilon_{ij}$$for i=1,2,...,a (that is, there are a groups)and j=1,2,...,n. $\epsilon_{ij}$ and $\alpha_i$ are ...
1 vote
88 views

### The problem of finding the maximum coefficient term in the binomial expansion,Find the value range of K

The problem is shown in the figure, and the result should be the range of K obtained at the end of the image ...
133 views

### How to find the K value in the probability inequality of binomial distribution?

dist = BinomialDistribution[100, 1/3] Solve[{PDF[dist, k] >= PDF[dist, k - 1], PDF[dist, k] >= PDF[dist, k + 1]}, k] // FullSimplify In this binomial ...
329 views

### Quickly simulating "mean-time until collision"

Edit high-level summary of problem/solutions in Mathematica community post Suppose I draw (with replacement) $k$ colored balls from bins with probabilities $h_1,\ldots,h_d$ until some color is drawn ...
78 views

### Work-arounds to InverseFunction not evaluating?

Inverse CDF of Marchenko Pastur fails to evaluate at seemingly random points as you can see below. Is there an easy workaround? ...
Suppose my year has $d$ days. I have a vector of probabilities of being born on those days as $h=p_1,\ldots,p_d$, and want to estimate the smallest $k$ such that probability of of birthday collision (...