gibbs_normal: Gibbs sampling of the normal sampling posterior

Description Usage Arguments Value Author(s) Examples

View source: R/gibbs_normal.R

Description

Implements Gibbs sampling for normal sampling with independent priors on the mean and precision

Usage

1
  gibbs_normal(s, P = 0.002, iter = 1000)

Arguments

s

a list with components y, the observed data, mu0, the prior mean of mu, sigma0, the prior standard deviation of mu, a, the shape parameter of the gamma prior on P, b, the rate parameter of the gamma prior on P

P

starting value of the precision parameter

iter

number of iterations

Value

matrix of simulated draws of (mu, P) from the algorithm

Author(s)

Jim Albert

Examples

1
2
3
s <- list(y = rnorm(20, 5, 2),
  mu0 = 10, sigma0 = 3, a = 1, b = 1)
out <- gibbs_normal(s, P = 0.01, iter=100)

ProbBayes documentation built on March 13, 2020, 1:31 a.m.