[R] Problems with dmvnorm and outer

David Winsemius dwinsemius at comcast.net
Sun Mar 28 17:11:48 CEST 2010


On Mar 28, 2010, at 9:36 AM, Severin Kacianka wrote:

> Hello David and Dennis,
>
> thank you two for your replies. You not only helped me solve my  
> problem, but also helper me to understand my problem better.
> Here is my -now working- code:
>
> x<-y<-seq(-4,4,len=40)
>
> g<-function(a,b) {
> 	dmvnorm(x=cbind(a,b),sigma=matrix(c(4,2,2,3), ncol = 2))
> }
> z<-outer(x,y,g)
> persp(x,y,z)


 From that point, you will get a better idea of what you are looking  
at with some additional views:
 > persp(x,y,z)
 > persp(x,y,z, theta=-45)
 > persp(x,y,z, theta=-60)
 > persp(x,y,z, theta=-90)
 > persp(x,y,z, theta=-135)
>
-- 

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list