gibbs_mean: Gibbs Sample for Single Mean and Variance

Description Usage Arguments Details

View source: R/RcppExports.R

Description

Gibbs sampler to sample mean and variance of one numeric variable

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
gibbs_mean(
  y,
  steps = 1000L,
  burnin = 1000L,
  thin = 1L,
  mu_0 = 0,
  sigma2_0 = 1e+06,
  alpha = 0.001,
  beta = 0.001
)

Arguments

y

a vector of values

steps

number of iterations to run Gibbs sampler for

burnin

number of burn-in iterations to discard before proper steps

thin

thinning factor (default 1)

mu_0

prior mean for mu (default 0)

sigma2_0

prior variance for mu (default 1e6)

alpha

prior shape parameter for sigma2 (default 1e-3)

beta

prior scale parameter for sigma2 (default 1e-3)

Details

Assumes conjugate Normal-Inverse-Gamma priors on mean and variance:

y \sim \mathrm{Normal}(μ, σ^2)


iNZightVIT/iNZightBayes documentation built on Dec. 20, 2021, 5:56 p.m.