gibbsNormal: Gibbs sampler for a normal random sample with a...

Description Usage Arguments Examples

View source: R/gibbs.R

Description

Simulates realisations from the posterior distribution for the mean and precision in a normal distribution based on a random sample and a semi-conjugate prior by using a Gibbs sampler.

Usage

1
gibbsNormal(N, initial, priorparam, n, xbar, s)

Arguments

N

length of MCMC chain.

initial

starting value for the algorithm.

priorparam

prior parameters b,c,g,h.

n

size of random sample.

xbar

mean of random sample.

s

standard deviation of random sample.

Examples

1
2
mcmcAnalysis(gibbsNormal(N=100,initial=c(10,0.25),
 priorparam=c(10,1/100,3,12),n=100,xbar=15,s=4.5),rows=2)

nclbayes documentation built on May 31, 2017, 3:13 a.m.

Search within the nclbayes package
Search all R packages, documentation and source code