Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #16118

Re: Understanding TransformedDistribution

From Itai Seggev <itais@wolfram.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Understanding TransformedDistribution
Date 2013-10-29 03:00 +0000
Message-ID <l4n8d9$av9$1@smc.vnet.net> (permalink)
References <20131028044008.90A2A6A13@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


On Mon, Oct 28, 2013 at 12:40:08AM -0400, Ernst H.K. Stelzer wrote:
> Through a question on StackExchange I came to know TransformedDistribution, which allows me to sort of develop new distributions based on the ones defined in Mathematica.  Instead of using my own functions, which work perfectly well, I now tried to repeat a number of older calculations using e.g. UniformDistribution.
> 
> When I combine two via
> 
> TransformedDistribution[2 (x - 4/5 y), {x \[Distributed] UniformDistribution[{-1, 1}],   y \[Distributed] UniformDistribution[{-(4/5), 4/5}]}]
> 
> to generate a kind of annular function and then look at the PDF, I get
> 
> PDF[%, x]
> 
> \[Piecewise]	1/4	-(18/25)<=x<=18/25
> 1/256 (82-25 x)	18/25<x<82/25
> 1/256 (82+25 x)	-(82/25)<x<-(18/25)
> 0	True
> 
> However, I expect, what I get when I enter
> 
> 2 (PDF[UniformDistribution[{-1, 1}], x] -
>    4/5 PDF[UniformDistribution[{-(4/5), 4/5}], x])
> 
> 2 ((\[Piecewise]	1/2	-1<=x<=1
> 0	True
> )-4/5 (\[Piecewise]	5/8	-(4/5)<=x<=4/5
> 0	True
> ))
> 
> Does anybody have a clue which mistake I made?

For one thing, your expectation isn't the PDF of anything--it's integral is
2/5, not 1. 

PDF is not in any sense a linear operation, because it must always integrate to
1.  TransformedDistribution[expr, dists] represnets the distribution of the
values of expr, given that its components are distribution according to dists.
This means your first input represent a distribution ranging from -82/25 (when
x is -1 and y 4/5) to 82/5 (when x is 1 and y 4/5).  Since x and y are
independent of piecewise constant distributions, you get a constant expectation
in the "middle" going up from and back down to zero linearly as you go the
maximum negative and positive values.

--
Itai Seggev
Mathematica Algorithms R&D
217-398-0700 

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Understanding TransformedDistribution Itai Seggev <itais@wolfram.com> - 2013-10-29 03:00 +0000

csiph-web