[R] Plot bivariate joint pdf

beetle2 samandbrendan at aapt.net.au
Tue May 12 00:59:03 CEST 2009


Thank you for your suggestions.
When you talked about the double itegral

did you mean solve the pdf for 1 variable by

\int \int_{0}^{1} X+y dydx

x^2/2 + x/2

Where this is a function of one variable.
Do I then plot this function ?

regards



David Winsemius wrote:
> 
> 
> 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  
>>> bivariate
>>> 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
>>>> plot(r)
>>>
>>> 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  
>> supposed
>> to be uniform?
>>
>> (2) you could get a reasonable representation of the solution  
>> (although
>> 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.
> 
> (4) ?integrate
> and search on "double integration".
> 
> David Winsemius, MD
> Heritage Laboratories
> West Hartford, CT
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 

-- 
View this message in context: http://www.nabble.com/Plot-bivariate-joint-pdf-tp23481872p23493212.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list