[R] Plot bivariate joint pdf
dwinsemius at comcast.net
Mon May 11 18:37:01 CEST 2009
On May 11, 2009, at 9:46 AM, Ben Bolker wrote:
> beetle2 wrote:
>> For a homework question.
>> I was wondering if rcmdr has a function to plot a graph of a
>> function of X and Y.
>> I have a function with joint pdf
>> fX,Y(x,y) = x+y for 0<x<1 , 0<y<1
>> I've tried
>>> x <- seq(0,1,.001)
>>> y <- seq(0,1,.001)
>>> r = x+y
>> but it seems to just add them together say .2+.2 .3+.3 not other
>> possibilities like
>> .9 + .1
> We don't do homework questions here, but a few hints:
> (1) the question doesn't seem to be fully specified. Are x and y
> to be uniform?
> (2) you could get a reasonable representation of the solution
> not necessarily one your prof would be happy with) by adding
> runif(10000,0,1) and runif(10000,0,1)
> (3) to do this analytically, think about convolutions and/or moment
> generating functions.
and search on "double integration".
David Winsemius, MD
West Hartford, CT
More information about the R-help