# Modeling Dependent Joint Distribution

I'm trying to model the joint pdf of (X,Y) from example 4.5.8 of the text Statistical Inference 2nd Edition, Casella, Berger (pg 199 of the pdf). Essentially,

X ~ Uniform[0,1]

Z ~ Unfiorm[0,1/10]

Y ~ X + Z

I want to make a 3D plot of the joint pdf (X,Y)

Here is what I have accomplished thus far:

n = 1000;
X = RandomVariate[UniformDistribution[{0, 1}], n];
Z = RandomVariate[UniformDistribution[{0, 1/10}], n];
Y = X + Z;
XY = Transpose[{X, Y}];
ListPlot[XY]


Which gives the plot similar to Fig 4.5.1 (b):

However, I would somehow like to use

Y = TransformedDistribution[
X + Z, {X \[Distributed] UniformDistribution[{0, 1}],
Z \[Distributed] UniformDistribution[{0, 1/10}]}];


To actually make a 3D plot of the joint pdf. I know about the Product Distribution function, but I'm not sure if it's applicable in this scenario as my random variables are not independent (Y depends on X).

my random variables are not independent (Y depends on X)

You can still use TransformedDistribution[]:

dist = TransformedDistribution[{x, x + z},
{x \[Distributed] UniformDistribution[{0, 1}],
z \[Distributed] UniformDistribution[{0, 1/10}]}];

{BlockRandom[SeedRandom[42]; ListPlot[RandomVariate[dist, 1000]]],
Plot3D[PDF[dist, {x, y}] // Evaluate, {x, 0, 1}, {y, 0, 1}]} // GraphicsRow


• This is great! Thanks for adding your code as I will hopefully be able to apply it to similar problems in the future. – TensorFlow Oct 25 '17 at 14:16