Re: [R] mnormt package for bivariate normal distribution

2020-06-17 Thread Abby Spurdle
I'm not familiar with the mnormt package. I'm guessing its documentation may answer some (if not all) of your questions. Note that my package, bivariate, wraps the dmvnorm function, from the mvtnorm package. library (bivariate) f <- nbvpdf ( 0, 0, #means X, Y 1, 1, #sds X, Y 0.5) #c

[R] mnormt package for bivariate normal distribution

2020-06-17 Thread Vahid Borji
Hi, my R friends, I am going to plot the surface of a bivariate normal distribution and its contours. I have written the below codes: library(MASS) set.seed(69) n <- 5000 x <- rnorm(n, 0, 15) y <- 0.5 * x + rnorm(n, 0, 10) z <- kde2d(x, y, n = 50) persp(z, theta = 55, phi = 35, shade = 0.