MCMC:Method 4 : MH Random walk with autoregressive chains

require(mvtnorm) mu <- c(1,2) cov_mat <- matrix(c(1, 0.9, 0.9, 1), 2, 2, TRUE) set.seed(1) sample_chol <- rmvnorm(2000, mu, cov_mat) x1<-sample_chol[,1] y1<-sample_chol[,2] sample_val <- function(x) {
相關文章
相關標籤/搜索