2
$\begingroup$

A number of functions operate with Mathematica's set of distributions e.g.

Through[{Mean, StandardDeviation, Variance}[UniformDistribution[{umin,umax}]]]

which returns the correct result

    {(umax + umin)/2, (umax - umin)/(2 Sqrt[3]), 1/12 (umax - umin)^2}

However, when I add two continuous distributions, thus creating a kind of annular distribution, it will not be evaluated.

Through[{Mean, StandardDeviation, Variance}[
  UniformDistribution[{umin, umax}] - 
   UniformDistribution[{\[Epsilon] umin, \[Epsilon] umax}]]]

I think I had a very good look at the Mathematica documentation but I simply could not find any indication of how to define "my own distribution".

Please note, that I know how to handle such functions, i.e., how to calculate the Mean ... The issue of this question is, are there ways in Mathematica, I have missed, that allow me to use Mathematica's functionality on distributions with my distributions I have defined using Mathematica's distributions.

$\endgroup$

1 Answer 1

5
$\begingroup$

The way to combine distributions would be to use TransformedDistribution. Your code could be written as follows:

Through[{Mean, StandardDeviation, Variance}[
  TransformedDistribution[
   x - y, 
   {
    x \[Distributed] UniformDistribution[{umin, umax}], 
    y \[Distributed] UniformDistribution[{\[Epsilon] umin, \[Epsilon] umax}]
   }
  ]]]

Mathematica graphics

If you want to define distributions that work like the built-in distributions, have a look at this workshop.

$\endgroup$
1
  • $\begingroup$ Thank you very much that was exactly what I was looking for. The collection guide/DerivedDistributions summarizes a number of other functions I was looking for. $\endgroup$ Commented Oct 26, 2013 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.