Fit a univariate normal (Gaussian) distribution to the observed data.
gibbsNorm(y, niter = 1000, priors = NULL)
A vector of observed pixel data.
The number of iterations of the algorithm to perform.
A list of priors for the parameters of the model.
A list containing MCMC samples for the mean and standard deviation.
# NOT RUN { 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 DataLab