Skip to contents

Calculates summary statistics of the output of the MCMC algorithm for multiple parameters. Results are given in calendar years (BC/AD).

Usage

# S4 method for MCMC
summary(object, level = 0.95)

# S4 method for PhasesMCMC
summary(object, level = 0.95)

Arguments

object

An MCMC or a PhasesMCMC object.

level

A length-one numeric vector giving the confidence level.

Value

A data.frame where the rows correspond to the chains of interest and columns to the following statistics:

mean

The mean of the MCMC chain.

sd

The standard deviation of the MCMC chain.

min

Minimum value of the MCMC chain.

q1

First quantile of the MCMC chain.

median

Median of the MCMC chain.

q3

Third quantile of the MCMC chain.

max

Maximum value of the MCMC chain.

lower

Lower boundary of the credible interval of the MCMC chain at level.

upper

Upper boundary of the credible interval of the MCMC chain at level.

See also

Other statistics: credible(), hpdi(), sensitivity()

Author

A. Philippe, M.-A. Vibet, T. S. Dye, N. Frerebeau

Examples

## Coerce to MCMC
eve <- as_events(events, calendar = "CE", iteration = 1)

## BP
eve_BP <- CE_to_BP(eve)
summary(eve_BP)
#>     mad mean  sd  min   q1 median   q3  max lower upper
#> E1 2849 2587 271 1954 2335   2607 2838 3298  2995  2151
#> E2 3715 3734  99 2920 3668   3734 3806 3949  3930  3560
#> E3 2651 2605  91 2016 2560   2621 2666 3178  2752  2399
#> E4 3190 3185  86 2668 3130   3184 3238 3813  3350  3013

## CE
eve_CE <- BP_to_CE(eve_BP)
summary(eve_CE)
#>      mad  mean  sd   min    q1 median    q3  max lower upper
#> E1  -900  -638 271 -1349  -889   -658  -386   -5 -1046  -202
#> E2 -1766 -1785  99 -2000 -1857  -1785 -1719 -971 -1981 -1611
#> E3  -702  -656  91 -1229  -717   -672  -611  -67  -803  -450
#> E4 -1241 -1236  86 -1864 -1289  -1235 -1181 -719 -1401 -1064

## Plot events
plot(eve_CE, interval = "credible", level = 0.68)
#> Picking joint bandwidth of 15.1

plot(eve_BP, interval = "hpdi", level = 0.68)
#> Picking joint bandwidth of 15.1


## Compute phases
pha <- phase(eve, groups = list(B = c(2, 4), A = c(1, 3)))
summary(pha)
#> $B
#>            mad  mean  sd   min    q1 median    q3   max lower upper
#> start    -1766 -1785  99 -2000 -1857  -1785 -1719 -1223 -1981 -1611
#> end      -1240 -1235  86 -1833 -1289  -1235 -1181  -719 -1404 -1067
#> duration   560   550 131     4   463    551   638  1156   296   805
#> 
#> $A
#>           mad mean  sd   min   q1 median   q3  max lower upper
#> start    -708 -773 147 -1349 -890   -749 -671 -207 -1059  -501
#> end      -690 -521 168 -1050 -670   -537 -384   -5  -776  -214
#> duration  277  252 137     0  150    248  344  879     0   486
#> 

## Plot phases
plot(pha)

plot(pha, range = "hiatus")

plot(pha, range = "transition")