Dear list, I am facing a problem with the rtmvtnorm function to sample from a truncated multivariate normal when some of the truncation boundaries are equal, e.g.:
>rtmvnorm(1, mean = rep(0,3), sigma = diag(3), lower=c(-1,0,-1), upper=c(1,0,1), algorithm="gibbs") Error in checkTmvArgs(mean, sigma, lower, upper) : lower must be smaller than or equal to upper (lower<=upper) Of course, since it is all about numerics I could do >rtmvnorm(1, mean = rep(0,3), sigma = diag(3), lower=c(-1,0,-1), upper=c(1,1e-16,1), algorithm="gibbs") [,1] [,2] [,3] [1,] -0.6221186 0 -0.6435531 but it is not entirely satisfying. Is it a normal behaviour of rtmvtnorm? Thanks in advance, jurgis [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.