9
votes
How can I define a distribution and get the expectation in Mathematica?
There are many ways. Here's one:
dist = TransformedDistribution[x aH + (1 - x) aL, x \[Distributed] BernoulliDistribution[λ]]
Mean[dist]
(* aL+aH λ-aL λ *)
7
votes
How can I define a distribution and get the expectation in Mathematica?
As JimB notes, there are many ways. Here's another:
...
7
votes
Accepted
How can I efficiently calculate exact probability distributions for D&D dice like "4d8"?
Based on eyorble's comment here's how to do it with generating functions. The main idea: with some probability distribution $p_n: P(X=n)=p_n$ you can associate a polynomial called the generating ...
7
votes
How can I efficiently calculate exact probability distributions for D&D dice like "4d8"?
Implementing @eyorble's idea in the comments:
problist[n_, d_] := Rest[CoefficientList[(1/d Sum[x^i, {i, 1, d}])^n, x]]
This returns a list of length $nd$ ...
5
votes
How can I efficiently calculate exact probability distributions for D&D dice like "4d8"?
Define two helper functions. One for the generator function of NdS expressed as a polynomial in terms of $x$:
dg[x_, n_, s_] := (x (x^s - 1)/(x - 1))^n;
And ...
4
votes
Choosing The Best Fitted Probability Distribution Model
Using AIC you can rank the goodness-of-fit for each probability distribution but that doesn't mean any of the fits are good or bad. Just a relative ranking.
But you don't want to use regression (i.e.,...
3
votes
2
votes
Estimating Parameters of a Custom Distribution
Estimates of parameters deserve estimates of precision. Unfortunately, FindDistributionParameters doesn't provide that. However, it is relatively easy to do in ...
1
vote
Spanning Subgraphs of random sizes with probabilities on edges
If you want to retain each edge in a graph g with probability p, you can use:
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
probability-or-statistics × 1707distributions × 507
fitting × 224
plotting × 171
random × 136
list-manipulation × 63
histograms × 59
calculus-and-analysis × 55
functions × 55
performance-tuning × 55
data × 49
numerical-integration × 48
mathematical-optimization × 40
matrix × 37
graphics × 35
bugs × 34
equation-solving × 33
programming × 28
simulation × 26
numerics × 24
symbolic × 24
machine-learning × 22
charts × 21
implementation-details × 19
time-series × 19