powered by
Function returns Gibbs samples from a bivariate normal target density.
BVN_Gibbs(n, mu, sigma)
Sample size of the Markov chain.
A 2 dimensional vector. Mean of the target normal distribution.
2 x 2 symmetric positive definite matrix. The covariance matrix of the target normal distribution.
An n x 2 matrix of the Gibbs samples.
# NOT RUN { n <- 1e3 mu <- c(2, 50) sigma <- matrix(c(1, 0.5, 0.5, 1), nrow = 2) out <- BVN_Gibbs(n, mu, sigma) # }
Run the code above in your browser using DataLab