Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

17
votes
5answers
826 views

Sisyphus Random Walk

A Sisyphus Random Walk evolves as follows: With probability (r) you advance the position of the walker by +1. With probability (1-r) the walker resets at x0 = 0. To simulate the probability of reset ...
7
votes
5answers
979 views

Survival Probability for Random Walks

The Survival Probability for a walker starting at the origin is defined as the probability that the walker stays positive through n steps. Thanks to the Sparre-Andersen Theorem I know this PDF is ...
16
votes
1answer
197 views

Possible bug in OrderDistribution? [Update: Confirmed by Wolfram Research and enqueued.]

Bug Introduced in 11.3 or earlier Observe: ...
3
votes
3answers
109 views

Efficient function for life duration probability?

Sent to me by a colleague asking me for assistance (the function as is breaks): ...
1
vote
2answers
102 views

Sampling data from numerical values of density distribution of nucleons

How could i sample my data which follows distribution if i have only numerical values of density distribution as an example data attached as in picture I tried but do not know how to do it. The data:...
0
votes
2answers
80 views

Finding area under a PDF

Suppose I have a PDF with mean a and standard deviation b defined as below. How would I go ...
0
votes
0answers
49 views

CDF of probability from a ClassifierFunction

I have a classifier function that classifies whether a student is likely to succeed in a course given their score on a placement test. From this, I am pulling both the probability of being successful ...
1
vote
1answer
47 views

How to pass starting values in matrix form?

Consider the following MWE, where I try to pass starting values to FindDistributionParameters[]: ...
1
vote
1answer
90 views

Finding the optimal probabilty distribution

I am trying to obtain the optimal probability distribution function to the following data. My attempt: ...
0
votes
2answers
50 views

Partitioning Mixture Distribution Dataset into constituent Distributions

Suppose I have a dataset that is derived from a random sampling from a mixture distribution ...
-1
votes
1answer
31 views

Is there a workaround for this Solve and NSolve error?

Using either Solve or NSolve gives the same error: ...
0
votes
0answers
27 views

How to solve when using a Cumulative Binomial Distribution function?

This is probably very simple, but I could not find the answer. How to solve? I tried Reduce as well to no avail. ...
0
votes
1answer
56 views

Model fitting for concave curve: test if asymptote or convergence exist

I am asking a double check if conceptually I set up proper model and proceeding in good direction to drive conclusions. I have a distribution that looks like this: I want to test if for increasing x ...
4
votes
2answers
79 views

Why does the PearsonChiSquare from FindDistribution and DistributionFitTest differ by a factor of $10^{20}$?

This is similar to the unanswered "Why the results of FindDistribution and DistributionFitTest are not consistent?" My more specific question is: Why do the PearsonChiSquare values for ...
0
votes
2answers
81 views

How to speed up this calculation regarding the normal distribution?

This calculation takes a very long time! Why? How can I improve it? Thanks! ...
0
votes
1answer
62 views

Producing a probability distribution numerically

Given that Mathematica could not produce a symbolic solution to the problem stated here, how can I produce many values of $A$ to then create $B$ numerically? ...
0
votes
2answers
99 views

Is this TransformedDistribution beyond Mathematica?

Creating the following transformed distribution $A$ A = TransformedDistribution[Sqrt[x^2], x \[Distributed] NormalDistribution[\[Mu], \[Sigma]]] and then using A ...
0
votes
0answers
54 views

Random points from an image using a BernoulliDistribution

I am a Mathematica newbie. I need to sample random points from an image which I have stored in a variable img as: ...
7
votes
2answers
322 views

Calculate mean normed distance and normed variance of cone-shaped distribution in N-dimensions

I would like to calculate the mean and variance of the normed distance of a cone-shaped distribution, $f(x) \propto \exp(-|x|)$, where $x\in\mathbb{R}^d$, where $d$ can be any positive integer. In ...
0
votes
1answer
56 views

Negative values with RandomVariate

I am using the following code to generate some random number from a custom distribution: ...
2
votes
3answers
39 views

Double differential distribution using set of data

Consider a set of data having the form $\{\{x_{1}, y_{1}\}, …,\{x_{n},y_{n}\}\}$. Each point from the set corresponds to 1 event with coordinate $x, y$. I'm looking for a procedure in Mathematica that ...
3
votes
2answers
90 views

How to apply assumptions to parameters for FindDistributionParameters?

Say I have data that I want to fit to a distribution while applying assumptions on one or more of the parameters. For example, for ParetoDistribution[k, α, μ] <...
4
votes
3answers
130 views

Construct Distribution Histogram From Random Variable

Given a Beta Random Variable $X$ with parameters $\alpha, \beta$ and a positive constant $n$, suppose I am interested in the distribution of: $$Y:=\lfloor nX\rfloor$$ Suppose I want a histogram ...
10
votes
3answers
580 views

Can I use Compile to speed up InverseCDF?

I'm repeatedly issuing the command P = InverseCDF[NormalDistribution[0, 1], T] where T is either a 36- or 64-vector of real numbers (points in the unit ...
0
votes
1answer
40 views

ProbabilityDistribution fails for square root

I would like to sampling data from a distribution Sqrt[x^2 + y^2]. I used the code as follows: ...
0
votes
2answers
43 views

Linear Combination of Normal Distributions

I'm just playing around with RandomVariate. Right now I can't really figure out why a linear combination with weights 0.5 of two identical normal distributions is not yielding the same distribution. 0....
0
votes
1answer
46 views

Arbitrary conditional multivariate expectation

I am interested in finding a conditional expectation of a multivariate Normal distribution. For example, let $X$ and $Y$ denote two random variables with a joint normal distribution. Let $X \sim N(\...
3
votes
2answers
58 views

Scale maximum width of distributions in DistributionChart proportional to sample size?

I am looking to compare three different distributions by making a chart with the three violin plots via DistributionChart. The distributions have different sample ...
0
votes
0answers
24 views

Check if some Intervals are evenly spread across a Timeline

I currently have the problem that I need to compute some characteristic number (would be good if its in 0-1 range) for the "evenness" of event starts. I have various Timeslots which consist of a ...
3
votes
1answer
131 views

Log transformed histogram distribution

Bug introduced in 11.0.1 or earlier and persisting through 11.3.0 or later I try to get a Log transformed histogram data I get from a different program ...
3
votes
1answer
62 views

How can Distribution fitting be sped up?

The first line generates 1050 data points to fit. The second line fits this data to the same distribution. This takes about 100ms on my computer. Doing this with ...
7
votes
2answers
1k views

Can this code be changed to run faster?

I've worked for several days trying to get this code to run faster. The imported data is 15MB. ...
1
vote
0answers
46 views

Why is this parallel notebook not maxing out the available memory and processors?

I've searched many questions about parallel processing here, and they are either specialized or over my head. I run the following parallel notebook on an 8 core EC2 instance. The average memory usage ...
4
votes
0answers
58 views

Why is ProbabilityDistribution 100x slower than ExtremeValueDistribution?

The two distributions are the same, except the ProbabilityDistribution cuts out below x=0. The wolfram documentation on ProbabilityDistribution says nothing about speed. A search of this site gave no ...
5
votes
1answer
66 views

Random normalised variable generation

I want to generate 8 random variables (in reality to form 4 complex numbers) such that the sum of the 8 variables squared is equal to unity. The aim of generating such numbers is to perform a quantum ...
0
votes
1answer
51 views

Fit to Binomial Function

I have the following data, and need to fit a binomial distribution to this data. I have already done so for a gaussian fit (this is the example code I have below), but I am having trouble using a ...
1
vote
1answer
46 views

ProbabilityDistributionQ

I have had a look through the documentation and I cannot find a ProbabilityDistributionQ function. How can I return True if the ...
1
vote
1answer
107 views

How to plot normal distribution with mean 10 and standard deviation 2? [closed]

My code is Plot[Table[PDF[NormalDistribution[10, 2], x], {x, 0, 20}]], but it just produces a blank plot. Why is this?
0
votes
1answer
48 views

What condition is missing here?

distE=NormalDistribution[0,s]; TransformedDistribution[(e/s)^2,e\[Distributed]distE,Assumptions->s>0] The transformed distribution is not ...
0
votes
1answer
98 views

Histograms and probability distributions

Consider $50$ random variables with probability distribution: $X∼Bin(20,.1)$, where $n=20$ and $p=.1$. Now take a random sample of size $i; \ i=1,5,12,30,40$ from the 50 random variables and plot ...
4
votes
3answers
281 views

Computing Credible Region (Highest Posterior Density) from Empirical Distribution

I have a dataset where values are distributed in some experimental way, not following any theoretical distribution. The dataset could be unimodal with a nicely defined single peak or multimodal with ...
1
vote
0answers
159 views

A simple/fast way to estimate distribution modality?

Is there a simple and performant way to estimate whether an empirical distribution generated from a list of data is unimodal and if not (or is reasonably uniform and doesn't have modality at all), to ...
3
votes
2answers
128 views

How to test if my results have a poisson distribution?

I have results in the form {elapsed time, number of individuals}. This might be considered a Poisson point process. Using Mathematica how do I check if my results ...
1
vote
1answer
83 views

Using EstimatedDistribution with custom circular ProbabilityDistribution

Basic Idea I'm attempting to estimate the distribution of a set of angle measurements. I have a custom probability distribution that I believe explains the measurements accurately and am attempting ...
0
votes
1answer
42 views

Use the Table command with growing steps. Is it possible? [duplicate]

Is it possible to use the Table function with growing steps? In other words, as the function proceeds it takes larger steps. The intention is to have a set of data with unequal distribution in which ...
0
votes
2answers
84 views

Discrete Probability Distribution with Lists

I'm trying to create a piecewise function with y values {.1, .2, .342, .353,...,.9} and x-values {1, 2, 3, 4,...,n}. My end goal is to do this: Define a simple discrete probability distribution and ...
0
votes
0answers
59 views

Mixture distribution fitting containing a uniform distribution

I have a dataset that is clearly the mixture of 3 known distributions which can be generated as follows: ...
0
votes
1answer
39 views

Finding λ in an exponential distribution

When $ λ $ is given with a given probablity of $X$, it's a simple program, where for example I can do ...
0
votes
0answers
49 views

Plot3D seems to be ignoring points

Consider the following function: f[n_, i_, g_]:= PDF[BinomialDistribution[n, g], i] The output of ...
0
votes
1answer
80 views

Comparison of two discrete distributions

I have a series of data sets whose distributions I would like to quantitatively compare using Mathematica. For the purpose of this explanation, I will show two extreme comparisons (4 data sets total), ...