Skip to content

Help with graph joint pdf

3 messages · AbouEl-Makarim Aboueissa, Sebastián Castro

#
I would do it in this way:

###########################################################################
u=seq(0.0001,1,0.1)
v=u
f=outer(u,v, function(u,v) 18*(u/v)*(1-u/v))
f
for (i in 2:length(u)) {
	for (j in 1:(i-1)) {
		f[i,j]=0
	}
}
f

persp( u, v, f, phi=30, theta=-30,col='red')
###########################################################################

Surely you (or someone) have a better solution to share.

Sebasti?n.
1 day later
#
I've found a 'better' solution:

###########################################################################
u=seq(0.0001,1,0.05)
v=u
f=outer(u,v, function(u,v) 18*(u/v)*(1-u/v))*outer(u, v, function(u,v)(u<v))
persp( u, v, f, phi=30, theta=-30,col='red')
###########################################################################

Sebasti?n.