Skip to content
Prev 3299 / 15380 Next

[R-es] (sin asunto)

Más o menos, así:

library( mvtnorm )

x <- y <- -20:20 / 10

z <- matrix( 0, length( x ), length( y ) )


m <- c(0,0)
sigma <- matrix( c(1, 0.5, 0.5, 1 ), 2 )

for( i in 1: length( x ) )
	for( j in 1:length( y ) )
		z[i,j] <- dmvnorm( c( x[i], y[j] ), c(0,0), sigma )

persp( x, y, z )

Un saludo,

Carlos J. Gil Bellosta
http://www.datanalytics.com

El día 15 de febrero de 2012 12:37, Usuario R <r.user.spain en gmail.com> escribió: