Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

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.

share|improve this answer
    
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. –  Ernst Stelzer Oct 26 '13 at 13:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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