BVN_Gibbs: MCMC samples from a bivariate normal distribution

Description Usage Arguments Value Examples

View source: R/MVG.R

Description

Function returns Gibbs samples from a bivariate normal target density.

Usage

1
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

1
2
3
4
n <- 1e3
mu <- c(2, 50)
sigma <- matrix(c(1, 0.5, 0.5, 1), nrow = 2)
out <- BVN_Gibbs(n, mu, sigma)

mcmcse documentation built on Sept. 9, 2021, 9:06 a.m.