multi_hpd {ArchaeoPhases} | R Documentation |
Estimation of the highest posterior density regions for each variable of a
simulated Markov chain. This function uses the hdr()
function
included in the hdrcde package. An HPD region may be a union of
several intervals.
multi_hpd(data, position, level = 0.95, round_to = 0)
data |
Data frame containing the output of the MCMC algorithm. |
position |
Numeric vector containing the position of the column corresponding to the MCMC chains of interest. |
level |
Probability corresponding to the level of confidence. |
round_to |
Integer indicating the number of decimal places. |
Highest posterior density function region using the function
hdr()
from the hdrcd package
Returns a list with the following components:
A data frame where the rows correspond to the columns
in the selected data set and the columns labeled inf
and sup
correspond to the lower and upper endpoints of each highest posterior
density interval, respectively.
Probability corresponding to the level of confidence.
The function call.
matrix of values containing the level of confidence and for each variable of the MCMC chain. The name of the resulting rows are the positions of the corresponding columns in the CSV file. The result is given in calendar years (BC/AD).
Anne Philippe, Anne.Philippe@univ-nantes.fr and
Marie-Anne Vibet, Marie-Anne.Vibet@univ-nantes.fr
Hyndman, R.J. (1996) Computing and graphing highest density regions. American Statistician, 50, 120-126.
data(Events)
multi_hpd(Events, c(2, 4, 3), 0.95)