[R] Problems with dmvnorm and outer

2010-03-28 Thread Severin Kacianka
Hello, I try to create a persp-plot for the bivariate normal distribution. There are a few solutions online ([1],[2]), but I did not want to hard-code the formula like [2] did or use a kernel density estimate like [1]. My plan was to use dmvnorm, and use outer to calculate the z-dimension

Re: [R] Problems with dmvnorm and outer

2010-03-28 Thread Severin Kacianka
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)) }