bayesImageS (version 0.3-3)

gibbsNorm: Fit a univariate normal (Gaussian) distribution to the observed data.

Description

Fit a univariate normal (Gaussian) distribution to the observed data.

Usage

gibbsNorm(y, niter = 1000, priors = NULL)

Arguments

y
A vector of observed pixel data.
niter
The number of iterations of the algorithm to perform.
priors
A list of priors for the parameters of the model.

Value

A list containing MCMC samples for the mean and standard deviation.

Examples

Run this code
y <- rnorm(100,mean=5,sd=2)
res.norm <- gibbsNorm(y, priors=list(mu=0, mu.sd=1e6, sigma=1e-3, sigma.nu=1e-3))
summary(res.norm$mu[501:1000])
summary(res.norm$sigma[501:1000])

Run the code above in your browser using DataCamp Workspace