# Tag Info

5

If you want to create a ProbabilityDistribution for a two-point random variable, here is one way to do so: x1 =. x2 =. p1 =. twoPointRV = TransformedDistribution[y x1 + (1 - y) x2, y \[Distributed] BinomialDistribution[1, p1]] Now you can use twoPointRV symbolically as a ProbabilityDistribution: mean = Expectation[x, x \[Distributed] twoPointRV] (* ...

2

You can specify such a ProbabilityDistribution by using DiracDelta which have some interesting properties: x1=1; x2=0; p1=.3; p2=.7; d = ProbabilityDistribution[p1 DiracDelta[x - x1] + p2 DiracDelta[ x-x2], {x, -Infinity, Infinity}]; RandomVariate[d] Expectation[x, x \[Distributed] d] ProbabilityDistribution will automatically transfrom your ...

0

You might want to look at HistogramDistribution. It provides a piecewise constant PDF. Since it is a distribution object, you can use RandomVariate, Mean, etc. on it.

0

data = {0.0258899, 0.047329, 0.0683456, 0.0861312, 0.103529, 0.118554, 0.124337, 0.127011, 0.131217, 0.134408, 0.132016, 0.130485, 0.127444, 0.122495, 0.117607, 0.112261, 0.108703, 0.10322, 0.100889, 0.0955182, 0.0902072, 0.085152, 0.079376, 0.0752159, 0.0722947, 0.0686795, 0.0653517, 0.062192, 0.0598642, 0.0569383, 0.0548917, 0.0513092, 0....

1

I agree with Jim Baldwin, but here is the code I put together based on this data originating from a random sample (Just in case that helps you for some reason). Your original problem was the 0 data point causing the functions not to evaluate. dist = {0.0258899, 0.047329, 0.0683456, 0.0861312, 0.103529, 0.118554, 0.124337, 0.127011, 0.131217, 0.134408, 0....

6

You don't seem to have a random sample from any probability distribution but rather have measurements/observations that might have a similar functional form as a probability density function. Your curve has an area of about 0.43 going from 0 to 10. While the tail of the distribution you envision might be heavy enough to hold the remaining 0.57 of a ...

1

This appears to be a bug. Histogram shows result of 100K RV on PascalDistribution[1,1/50] for 100k batch using RandomVariate[...,100000] (blue) and generating a table of 100k single calls (default chicken-poop-and-mud jaundice beige): Thanks to Karsten for verification and Jim for histogram idea.

1

In the t1 case RandomDistributionVector[PascalDistribution[1, 1/50], 10000, ∞] is evaluated and in the t2 case RandomDistributionVector[PascalDistribution[1, 1/50], 10, ∞] The definition of this function contains a Which statement. Its first test is True for 10000 and False for 10. Its second test (there are only two) is True. For your parameters ...

1

Just an extended comment: Rather than a consistent shift for the values in the minimum values for t2, it appears that the distribution is completely different than for t1, t3, and t4. Here's a figure showing that: h[x_, label_] := Histogram[Min /@ x, {1}, "PDF", PlotRange -> {{0, 30}, {0, 0.20}}, PlotLabel -> Style[label, Bold, Larger]] ...

Top 50 recent answers are included