Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Highest Posterior Density(HPD)

Hi Team,

If there is any way, please help me in calculating HPD manually (preferably  in Excel).

Narasimha Rao
asked Dec 4, 2017 by Narasimha Rao Tadekoru

1 Answer

0 votes

I am going to assume you already have your draws for the part-worth you want to compute the HPD for and that your draws have a unimodal (one peak) distribution.

If you are trying to compute a 95% HPD, then you are looking for the *narrowest* interval that contains 95% of your draws.  

Here are the steps in Excel:

1) Sort your draws for the column you are trying to compute the HPD for.

2) Figure out how many draws represents 95% of your data (assuming you're looking for a 95% interval), which would be:

k = (size of sample)*(0.95)

3) Compute 'item k' minus 'item 1'
Compute 'item k+1' minus 'item 2'
repeat until 'item n' minus 'item k-n'

4) Whichever result from step 3 is the smallest, those are the bounds of your 95% HPD.
answered Dec 4, 2017 by Kenneth Fairchild Bronze Sawtooth Software, Inc. (3,195 points)
Draws for the part-worth you want to compute the HPD