Learn R Programming

mcmcse (version 1.5-0)

BVN_Gibbs: MCMC samples from a bivariate normal distribution

Description

Function returns Gibbs samples from a bivariate normal target density.

Usage

BVN_Gibbs(n, mu, sigma)

Arguments

n

Sample size of the Markov chain.

mu

A 2 dimensional vector. Mean of the target normal distribution.

sigma

2 x 2 symmetric positive definite matrix. The covariance matrix of the target normal distribution.

Value

An n x 2 matrix of the Gibbs samples.

Examples

Run this code
# 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