Step 3 Repeat above Step 1 and Step 2 times, and samples of are generated as .
Step 4 The Bayes estimate of with respect to squared error loss, can be constructed as
where is burn-in period.
Step 5 To construct the HPD credible interval of , first arrange all estimates , in an ascend order, as , then for arbitrary the credible interval of can be obtained as
where denotes the greatest integer less than or equal to . Therefore, the HPD credible interval can be constructed as the th one satisfying