Package 'RChronoModel'

Title: Post-Processing of the Markov Chain Simulated by ChronoModel or Oxcal
Description: Provides a list of functions for the statistical analysis and the post-processing of the Markov Chains simulated by ChronoModel (see <http://www.chronomodel.fr> for more information). ChronoModel is a friendly software to construct a chronological model in a Bayesian framework. Its output is a sampled Markov chain from the posterior distribution of dates component the chronology. The functions can also be applied to the analyse of mcmc output generated by Oxcal software.
Authors: Anne Philippe and Marie-Anne Vibet
Maintainer: Anne Philippe <[email protected]>
License: GPL
Version: 0.4
Built: 2024-09-15 03:30:16 UTC
Source: https://github.com/cran/RChronoModel

Help Index


Constructing the minimum and the maximum for a group of dates(phase)

Description

Constructs a dataframe containing the output of the MCMC algorithm corresponding to the minimum and the maximum of a group of dates (phase)

Usage

CreateMinMaxGroup(data, position, name ="Phase", add=NULL, exportFile=NULL)

Arguments

data

dataframe containing the output of the MCMC algorithm

position

numeric vector containing the position of the column corresponding to the MCMC chains of all dates included in the phase of interest

name

name of the current group of dates or phase

add

the name of the dataframe in which the current minimum and maximum should be added. Null by default.

exportFile

the name of the final file that will be saved if chosen. Null by default.

Value

A dataframe containing the minimum and the maximum of the group of dates included in the phase of interest. These values may be added to an already existing file "add" if given.

Author(s)

Anne Philippe <[email protected]> and

Marie-Anne Vibet <[email protected]>

Examples

data(Events)
    Temp = CreateMinMaxGroup(Events, c(2,4), "Phase2")
    Temp = CreateMinMaxGroup(Events, c(3,5), "Phase1", Temp)

Bayesian credible interval

Description

Computes the shortest credible interval at the desired level.

Usage

CredibleInterval(a_chain, level = 0.95)

Arguments

a_chain

numeric vector containing the output of the MCMC algorithm for a one-parameter

level

probability corresponding to the level of confidence used for the credible interval

Details

A (100 * level) % credible intervalgives the shortest interval, whose posterior probability is equal to the desired level. This interval is approximated by constructing the shortest interval such that N*(1-level) elements of the sample are outside the interval.

Value

Returns a vector of values containing the level of confidence and the endpoints of the shortest credible interval.

Author(s)

Anne Philippe <[email protected]> and

Marie-Anne Vibet <[email protected]>

Examples

data(Events); attach(Events)

  CredibleInterval(Event.1)
  CredibleInterval(Event.12, 0.50)

Test for the existence of a hiatus between two parameters

Description

Finds if it exists a gap between two dates that is the longest interval that satisfies : P(a_chain < IntervalInf < IntervalSup < b_chain | M) = level

Usage

DatesHiatus(a_chain, b_chain, level=0.95)

Arguments

a_chain

numeric vector containing the output of the MCMC algorithm for the first one-parameter (date) a

b_chain

numeric vector containing the output of the same MCMC algorithm for the second one-parameter (date) b

level

probability corresponding to the level of confidence used for the credible interval and the highest density region

Value

Returns the endpoints of the longest hiatus between two parameters

Author(s)

Anne Philippe <[email protected]> and

Marie-Anne Vibet <[email protected]>

Examples

data(Events); attach(Events)
  DatesHiatus(Event.1, Event.12)
  DatesHiatus(Event.1, Event.12, level = 0.5)

Events

Description

Contains the output of the MCMC algorithm for four events modelled by ChronoModel.

Usage

data(Events)

Format

A data frame with 30000 observations on the following 5 variables.

iter

a numeric vector corresponding to iteration number

Event.1

a numeric vector containing the output of the MCMC algorithm for the parameter Event 1

Event.12

a numeric vector containing the output of the MCMC algorithm for the parameter Event 12

Event.2

a numeric vector containing the output of the MCMC algorithm for the parameter Event 2

Event.22

a numeric vector containing the output of the MCMC algorithm for the parameter Event 22

Author(s)

Anne Philippe <[email protected]> and

Marie-Anne Vibet <[email protected]>

Examples

data(Events)
summary(Events)

Importing a CSV file containing the output of the MCMC algorithm

Description

Use of the read.csv with th default values for CSV files extracted from ChronoModel software

Usage

ImportCSV(file, dec = '.', sep=',', comment.char='#', header = TRUE)

Arguments

file

the name of the CSV file containing the output of the MCMC algorithm

dec

the character used in the file for decimal points for the use of read.csv()

sep

the field separator character for the use of read.csv()

comment.char

a character vector of length one containing a single character or an empty string for the use of read.csv()

header

a logical value indicating whether the file contains the names of the variables as its first line.

Value

Returns a dataframe containing a representation of the data in the file.

Author(s)

Anne Philippe <[email protected]> and

Marie-Anne Vibet <[email protected]>

Examples

data(Events)
  write.csv(Events, "data.csv", row.names=FALSE)
  ImportCSV("data.csv")
  ImportCSV("data.csv", dec = '.', sep=',', comment.char='#', header = TRUE)

Plot of a marginal posterior density

Description

This function draws the density of a one-parameter and adds summary statistics.

Usage

MarginalPlot(a_chain, level = 0.95, title = "Marginal posterior density",
  colors = T, GridLength = 1024)

Arguments

a_chain

numeric vector containing the output of the MCMC algorithm for a one-parameter

level

probability corresponding to the level of confidence

title

label of the title

colors

if TRUE -> use of colors in the graph

GridLength

length of the grid used to estimate the density

Details

The density is estimated using density() function with n=GridLength.

Value

Draws a plot of the estimated marginal posterior density for the one-parameter and adds the mean and the credible interval at the desired level

Author(s)

Anne Philippe <[email protected]> and

Marie-Anne Vibet <[email protected]>

Examples

data(Events); attach(Events)

  MarginalPlot(Event.1, 0.95)
  MarginalPlot(Event.1, 0.50)

  MarginalPlot(Event.2, 0.95, title="Marginal density plot of Event 2")
  MarginalPlot(Event.2, 0.95, colors = FALSE)

Bayesian test for anteriority / posteriority between two parameters

Description

This function estimates the posterior probability that event 'a' is older than event 'b' using the output of the MCMC algorithm. This provides a bayesian test for checking the following assumption: "Event a is older than event b"

Usage

MarginalProba(a_chain, b_chain)

Arguments

a_chain

numeric vector containing the output of the MCMC algorithm for the first one-parameter (date) a

b_chain

numeric vector containing the output of the same MCMC algorithm for the second one-parameter (date) b

Details

For a given output of MCMC algorithm, this function estimates the posterior probability of the event 'a' < 'b' by the relative frenquency of the event "the value of event 'a' is lower than the value of event 'b'" in the simulated Makov chain.

Value

Returns the posterior probability of the following assumption: "Event a is older than event b"

Author(s)

Anne Philippe <[email protected]> and

Marie-Anne Vibet <[email protected]>

Examples

data(Events); attach(Events)

  # Probability that Event.1 is older than Event.12
  MarginalProba(Event.1, Event.12)
  # Probability that Event.1 is older than Event.2
  MarginalProba(Event.1, Event.2)

  # Probability that the beginning of the phase 1 is older than the end of the phase 1
  # Should always be 1 for every phase
  data(Phases); attach(Phases)

  MarginalProba(Phase.1.alpha, Phase.1.beta)

Marginal summary statistics

Description

Gives a list of summary statistics resulting from the output of the MCMC algorithm for a one-parameter.

Usage

MarginalStatistics(a_chain, level = 0.95, max_decimal = 0)

Arguments

a_chain

numeric vector containing the output of the MCMC algorithm for a one-parameter

level

probability corresponding to the level of confidence used for the credible interval and the highest density region

max_decimal

maximum number of decimal

Details

The 100*level % HPD (highest posterior density) region is estimated using HDR function from Package 'hdrcde'.

Value

A matrix of values corresponding to the following summary statistics

title

The title of the summary statistics

mean

The mean of the MCMC chain. Use of "mean" function.

map

The maximum a posteriori of the MCMC chain. Use of "hdr" function.

sd

The standard deviation of the MCMC chain. Use of "sd" function.

Q1, median, Q3

The quantiles of the MCMC chain corresponding to 0.25, 0.50 and 0.75. Use of "quantile" function.

CI

The credible interval corresponding to the desired level. Use of "CredibleInterval" function.

HPDR

The highest posterior density regions corresponding to the desired level. Use of "hdr" function.

Author(s)

Anne Philippe <[email protected]> and

Marie-Anne Vibet <[email protected]>

References

Hyndman, R.J. (1996) Computing and graphing highest density regions. American Statistician, 50, 120-126.

Examples

data(Events); attach(Events)
  
  MarginalStatistics(Event.1)
  MarginalStatistics(Event.2, level = 0.90)

Bayesian credible intervals for a series of dates

Description

Estimation of the shorest credible interval for each variables of simulated Markov chain.

Usage

MultiCredibleInterval(data, position, level = 0.95)

Arguments

data

dataframe 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 used to estimate the credible interval

Value

Returns a matrix of values containing the level of confidence and the endpoints of the shortest credible interval for each variable of the MCMC chain. The name of the resulting rows are the positions of the corresponding columns in the CSV file.

Author(s)

Anne Philippe <[email protected]> and

Marie-Anne Vibet <[email protected]>

Examples

data(Events)
  MultiCredibleInterval(Events, c(2,4,3), 0.95)

Plot of the endpoints of credible intervals or HPD intervals of a series of dates

Description

Draws a plot of segments corresponding to the endpoints of the intervals (CI or HPD) of each selected date.

Usage

MultiDatesPlot(data, position, level = 0.95,  intervals = c("CI", "HPD"), 
title = "Plot of intervals")

Arguments

data

dataframe 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 used to estimate the credible interval

intervals

"CI" corresponds to the credible intervals, "HPD" to the highest density regions

title

title of the graph

Author(s)

Anne Philippe <[email protected]> and

Marie-Anne Vibet <[email protected]>

Examples

data(Events)
  MultiDatesPlot(Events, c(2,4,3), level = 0.95, intervals ="CI", title = "Plot of CI intervals")
  MultiDatesPlot(Events, c(2,4,3), level = 0.95, intervals ="HPD", title = "Plot of HPD intervals")

Bayesian highest posterior density regions for a series of MCMC chains

Description

Estimation of the highest posterior density regions for each variables of simulated Markov chain. This function uses the "hdr" function oincluded in the package "hdrcde.

Usage

MultiHPD(data, position, level=0.95)

Arguments

data

dataframe 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

Value

Returns a matrix of values containing the level of confidence and the endpoints of each interval for each variable of the MCMC chain. The name of the resulting rows are the positions of the corresponding columns in the CSV file.

Author(s)

Anne Philippe <[email protected]> and

Marie-Anne Vibet <[email protected]>

References

Hyndman, R.J. (1996) Computing and graphing highest density regions. American Statistician, 50, 120-126.

Examples

data(Events)
  MultiHPD(Events, c(2,4,3), 0.95)

Plot of the marginal posterior densities of several phases

Description

Draws a plot with the marginal posterior densities of the minimum and the maximum of the dates included in each phase. No temporal order between phases is required.

Usage

MultiPhasePlot(data, position_minimum, position_maximum = position_minimum+1,
level = 0.95,  title = "Phases marginal posterior densities")

Arguments

data

dataframe containing the output of the MCMC algorithm

position_minimum

numeric vector containing the column number corresponding to the minimum of the dates included in each phase

position_maximum

numeric vector containing the column number corresponding to the maximum of the dates included in each phase. By default, position_maximum = position_minimum + 1.

level

probability corresponding to the level of confidence

title

title of the graph

Value

Draws a plot with the marginal posterior densities of the minimum and the maximum of the dates included in each phase and adds the time range of each phase.

Author(s)

Anne Philippe <[email protected]> and

Marie-Anne Vibet <[email protected]>

Examples

# Data extracted from ChronoModel software
  data(Phases)
  
  # List of the name of the phases 
  names(Phases)
  
  # Stipulating position_maximum
  MultiPhasePlot(Phases, c(4,2), c(5,3), title = "Succession of phase 1 and phase 2")
  
  # In this case, equivalent to 
  MultiPhasePlot(Phases, c(4,2), title = "Succession of phase 1 and phase 2")

Gap/Hiatus between a succession of phases (for phases in temporal order constraint)

Description

This function finds, if it exists, the gap between two successive phases. This gap or hiatus is the longest interval [IntervalInf, IntervalSup] that satisfies : P(Phase1Max < IntervalInf < IntervalSup < Phase2Min | M) = level for each successive phase.

Usage

MultiPhasesGap(data, position_minimum, position_maximum = position_minimum+1,
 level = 0.95, max_decimal = 0)

Arguments

data

dataframe containing the output of the MCMC algorithm

position_minimum

numeric vector containing the column number corresponding to the minimum of the dates included in each phase

position_maximum

numeric vector containing the column number corresponding to the maximum of the dates included in each phase. By default, position_maximum = position_minimum + 1.

level

probability corresponding to the level of confidence

max_decimal

maximum number of decimal

Details

For each i, MultiPhasesGap computes the gap interval for the phase defined by its minimum position_minimum[i] and its maximum position_maximum[i]. The default value of position_maximum corresponds to CSV files exported from ChronoModel software.

Value

Returns a matrix of values containing the level of confidence and the endpoints of the gap for each pair of successive phases

Author(s)

Anne Philippe <[email protected]> and

Marie-Anne Vibet <[email protected]>

Examples

# Data extracted from ChronoModel software
  data(Phases)
  
  # List of the name of the phases 
  names(Phases)
  
  # Stipulating position_maximum
  MultiPhasesGap(Phases, c(4,2), c(5,3))
  
  # In this case, equivalent to 
  MultiPhasesGap(Phases, c(4,2))

Transition range for a succession of phases (for phases in temporal order constraint)

Description

Finds if it exists the shortest interval [TransitionRangeInf, TransitionRangeSup] that satisfies : P(TransitionRangeInf < Phase1Max < Phase2Min < TransitionRangeSup | M) = level for each phase

Usage

MultiPhasesTransition(data, position_minimum, position_maximum = position_minimum+1, 
level = 0.95, max_decimal = 0)

Arguments

data

dataframe containing the output of the MCMC algorithm

position_minimum

numeric vector containing the column number corresponding to the minimum of the dates included in each phase

position_maximum

numeric vector containing the column number corresponding to the maximum of the dates included in each phase. By default, position_maximum = position_minimum + 1.

level

probability corresponding to the level of confidence

max_decimal

maximum number of decimal

Details

For each i, MultiPhasesTransition computes the transition interval for the phase defined by its minimum position_minimum[i] and its maximum position_maximum[i]. The default value of position_maximum corresponds to CSV files exported from ChronoModel software.

Value

Returns a matrix of values containing the level of confidence and the endpoints of the transition interval for each pair of successive phases

Author(s)

Anne Philippe <[email protected]> and

Marie-Anne Vibet <[email protected]>

Examples

# Data extracted from ChronoModel software
  data(Phases)
  
  # List of the name of the phases 
  names(Phases)
  
  # Stipulating position_maximum
  MultiPhasesTransition(Phases, c(4,2), c(5,3))
  
  # In this case, equivalent to 
  MultiPhasesTransition(Phases, c(4,2))

Phase Time Range for multiple phases

Description

Computes the shortest interval that satisfies : P(PhaseMin < IntervalInf < IntervalSup < PhaseMax | M) = level

Usage

MultiPhaseTimeRange(data, position_minimum, position_maximum = position_minimum+1,
 level = 0.95, max_decimal = 0)

Arguments

data

dataframe containing the output of the MCMC algorithm

position_minimum

numeric vector containing the column number corresponding to the minimum of the dates included in each phase

position_maximum

numeric vector containing the column number corresponding to the maximum of the dates included in each phase. By default, position_maximum = position_minimum + 1.

level

probability corresponding to the desired level of confidence

max_decimal

maximum number of decimal

Details

For each i, MultiPhaseTimeRange computes the time range interval for the phase defined by its minimum position_minimum[i] and its maximum position_maximum[i]. The default value of position_maximum corresponds to CSV files exported from ChronoModel software.

Value

Returns a matrix of values containing the level of confidence and the endpoints of the shortest time range associated with the desired level

Author(s)

Anne Philippe <[email protected]> and

Marie-Anne Vibet <[email protected]>

Examples

# Data extracted from ChronoModel software
  data(Phases)
  
  # List of the name of the phases 
  names(Phases)
  
  # Stipulating position_maximum
  MultiPhaseTimeRange(Phases, c(4,2), c(5,3))
  
  # In this case, equivalent to 
  MultiPhaseTimeRange(Phases, c(4,2))

Successive Phases Density Plots (for phases in temporal order constraint)

Description

This functions draws a plot of the densities of several successive phases and adds several statistics (mean, CI, HPDR)

Usage

MultiSuccessionPlot(data, position_minimum, position_maximum = position_minimum+1,
 level = 0.95, title = "Characterisation of a succession of phases")

Arguments

data

dataframe containing the output of the MCMC algorithm

position_minimum

numeric vector containing the column number corresponding to the minimum of the dates included in each phase

position_maximum

numeric vector containing the column number corresponding to the maximum of the dates included in each phase. By default, position_maximum = position_minimum + 1.

level

probability corresponding to the level of confidence

title

title of the graph

Details

Curves represent the density of the minimum (oldest dates) and the maximum (youngest dates) of the dates included in each phase. Curves of the same color refer to the same phase. When there is only one curve of one color, it means that there is only one event in the corresponding phase and then the minimum equals the maximum. Time range intervals are symbolised by segments above the curves drawn using the same color as the one of the curves of the associated phase. Transition and gap range intervals are represented by two-coloured segments using the colors of successive phases. If the gap between the successive phases does not exist, a cross is drawn instead of a segment.

Value

Returns a plot of all densities and adds several summary statistics

Author(s)

Anne Philippe <[email protected]> and

Marie-Anne Vibet <[email protected]>

Examples

# Data extracted from ChronoModel software
  data(Phases)
  
  # List of the name of the phases 
  names(Phases)
  
  # Stipulating position_end
  MultiSuccessionPlot(Phases, c(4,2), c(5,3), title = "Succession of phase 1 and phase 2")
  
  # In this case, equivalent to 
  MultiSuccessionPlot(Phases, c(4,2), title = "Succession of phase 1 and phase 2")

Plot of the marginal posterior densities of the duration of a phase

Description

This function draws the marginal posterior densities of the time elapsed between the minimum and the maximum of the dates included in a phase, and adds summary statistics (mean, CI)

Usage

PhaseDurationPlot(PhaseMin_chain, PhaseMax_chain, level=0.95, 
title = "Duration of the phase", colors = T, GridLength=1024)

Arguments

PhaseMin_chain

numeric vector containing the output of the MCMC algorithm for the minimum of the dates included in the phase

PhaseMax_chain

numeric vector containing the output of the MCMC algorithm for the maximum of the dates included in the phase

level

probability corresponding to the level of confidence used for the credible interval and the time range

title

title of the graph

colors

if TRUE -> use of colors in the graph

GridLength

length of the grid used to estimate the density

Value

A plot with the marginal posterior densities of the duration of a phase and adds several summary statistics (mean, Credible interval, Time range)

Author(s)

Anne Philippe <[email protected]> and

Marie-Anne Vibet <[email protected]>

Examples

data(Phases); attach(Phases)

  PhaseDurationPlot(Phase.1.alpha, Phase.1.beta, 0.95, "Duration of Phase 1")
  PhaseDurationPlot(Phase.2.alpha, Phase.2.beta, 0.95, "Duration of Phase 2",colors = FALSE)

Plot of the marginal posterior densities of a phase

Description

This function draws the marginal posterior densities of the minimum and the maximum of the dates included in the phase

Usage

PhasePlot(PhaseMin_chain, PhaseMax_chain, level = 0.95,
  title = "Characterisation of a phase", colors = T,
  GridLength = 1024)

Arguments

PhaseMin_chain

numeric vector containing the output of the MCMC algorithm for the minimum of the dates included in the phase

PhaseMax_chain

numeric vector containing the output of the MCMC algorithm for the maximum of the dates included in the phase

level

probability corresponding to the level of confidence used for the credible interval and the time range

title

title of the graph

colors

if TRUE -> use of colors in the graph

GridLength

length of the grid used to estimate the density

Value

A plot with the marginal posterior densities of the minimum and the maximum of the dates included in the phase and adds several summary statistics (mean, Credible interval, Time range)

Author(s)

Anne Philippe <[email protected]> and

Marie-Anne Vibet <[email protected]>

Examples

data(Phases); attach(Phases)

  PhasePlot(Phase.1.alpha, Phase.1.beta, 0.95, "Densities of Phase 1")
  PhasePlot(Phase.2.alpha, Phase.2.beta, 0.95, "Densities of Phase 2",colors = FALSE)

Phases

Description

Contains the output of the MCMC algorithm for all the phases (beginning and end) of two successive phases modelled in ChronoModel. Phase 1 is assued to be older than Phase 2.

Usage

data(Phases)

Format

A data frame with 30000 observations on the following 5 variables.

iter

a numeric vector corresponding to iteration number

Phase.1.alpha

a numeric vector containing the output of the MCMC algorithm for the beginning of the phase "Phase 1"

Phase.1.beta

a numeric vector containing the output of the MCMC algorithm for the end of the phase "Phase 1"

Phase.2.alpha

a numeric vector containing the output of the MCMC algorithm for the the beginning of the phase "Phase 2"

Phase.2.beta

a numeric vector containing the output of the MCMC algorithm for the end of the phase "Phase 2"

Author(s)

Anne Philippe <[email protected]> and

Marie-Anne Vibet <[email protected]>

Examples

data(Phases)
  attach(Phases)
  PhasePlot(Phase.1.alpha, Phase.1.beta)
  PhaseTimeRange(Phase.1.alpha, Phase.1.beta)

  PhasesGap(Phase.1.beta, Phase.2.alpha)
  PhasesTransition(Phase.1.beta, Phase.2.alpha)

Gap or Hiatus between two successive phases (for phases in temporal order constraint)

Description

This function finds, if it exists, the gap between two successive phases. This gap or hiatus is the longest interval [IntervalInf ; IntervalSup] that satisfies : P(Phase1Max_chain < IntervalInf < IntervalSup < Phase2Min_chain | M) = level.

Usage

PhasesGap(Phase1Max_chain, Phase2Min_chain, level = 0.95,
  max_decimal = 0)

Arguments

Phase1Max_chain

numeric vector containing the output of the MCMC algorithm for the maximum of the dates included in the oldest phase

Phase2Min_chain

numeric vector containing the output of the MCMC algorithm for the minimum of the dates included in the youngest phase

level

probability corresponding to the level of confidence

max_decimal

maximum number of decimal

Value

Returns a vector of values containing the level of confidence and the endpoints of the gap between the successive phases

Author(s)

Anne Philippe <[email protected]> and

Marie-Anne Vibet <[email protected]>

Examples

data(Phases); attach(Phases)
  PhasesGap(Phase.1.beta, Phase.2.alpha, 0.95)
  PhasesGap(Phase.1.beta, Phase.2.alpha, 0.50)

Summary statistics for a phase

Description

Estimation of several summary statistics of the minimum, the maximum and the duration of the dates included in the phase.

Usage

PhaseStatistics(PhaseMin_chain, PhaseMax_chain, level = 0.95,
  max_decimal = 0)

Arguments

PhaseMin_chain

numeric vector containing the output of the MCMC algorithm for the minimum of the dates included in the phase

PhaseMax_chain

numeric vector containing the output of the MCMC algorithm for the maximum of the dates included in the phase

level

probability corresponding to the level of confidence used for the credible interval and the highest density region

max_decimal

maximum number of decimal

Details

The summary statistics are those given by MarginalStatistics function. The time range is given by PhaseTimeRange function. The duration is computed as follow duration = maximum - minimum at each iteration of the MCMC output.

Value

Returns a list of values corresponding to the summary statistics:

1

Statistics of the minimum of the dates included in the phase

2

Statistics of the maximum of the dates included in the phase

3

Statistics of the duration of the dates included in the phase

4

The endpoints of the phase time range

Author(s)

Anne Philippe <[email protected]> and

Marie-Anne Vibet <[email protected]>

Examples

data(Phases); attach(Phases)
  PhaseStatistics(Phase.1.alpha, Phase.1.beta, 0.95, 0)
  PhaseStatistics(Phase.2.alpha, Phase.2.beta, 0.95, 0)

Transition range between two successive phases (for phases in temporal order constraint)

Description

Finds if it exists the shortest interval [TransitionRangeInf , TransitionRangeSup ] that satisfies : P(TransitionRangeInf < Phase1Max_chain < Phase2Min_chain < TransitionRangeSup | M) = level

Usage

PhasesTransition(Phase1Max_chain, Phase2Min_chain, level = 0.95,
  max_decimal = 0)

Arguments

Phase1Max_chain

numeric vector containing the output of the MCMC algorithm for the maximum of the dates included in the oldest phase

Phase2Min_chain

numeric vector containing the output of the MCMC algorithm for the minimum of the dates included in the youngest phase

level

probability corresponding to the level of confidence

max_decimal

maximum number of decimal

Value

Returns a vector of values containing the level of confidence and the endpoints of the transition interval between the successive phases

Author(s)

Anne Philippe <[email protected]> and

Marie-Anne Vibet <[email protected]>

Examples

data(Phases); attach(Phases)
  PhasesTransition(Phase.1.beta, Phase.2.alpha, 0.95)
  PhasesTransition(Phase.1.beta, Phase.2.alpha, 0.50)

Phase Time Range

Description

Computes the shortest interval [IntervalInf ; IntervalSup ] that satisfies : P(PhaseMin_chain =< IntervalInf < IntervalSup =< PhaseMax_chain | M) = level.

Usage

PhaseTimeRange(PhaseMin_chain, PhaseMax_chain, level = 0.95,
  max_decimal = 2)

Arguments

PhaseMin_chain

numeric vector containing the output of the MCMC algorithm for the minimum of the dates included in the phase

PhaseMax_chain

numeric vector containing the output of the MCMC algorithm for the maximum of the dates included in the phase

level

probability corresponding to the desired level of confidence

max_decimal

maximum number of decimal

Value

A vector of values containing the desired level of confidence and the endpoints of the shortest time range associated with this desired level.

Examples

data(Phases); attach(Phases)
  PhaseTimeRange(Phase.1.alpha, Phase.1.beta, 0.95)
  PhaseTimeRange(Phase.2.alpha, Phase.2.beta, 0.95, 0)

Density Plots of two successive phases (for phases in temporal order constraint)

Description

Plot of the densities of the minimum and the maximum of the dates included in each phase and adds several summary statistics (mean, CI, HPDR)

Usage

SuccessionPlot(Phase1Min_chain, Phase1Max_chain, Phase2Min_chain,
  Phase2Max_chain, level = 0.95,
  title = "Characterisation of several phases", GridLength = 1024)

Arguments

Phase1Min_chain

numeric vector containing the output of the MCMC algorithm for the minimum of the dates included in the oldest phase

Phase1Max_chain

numeric vector containing the output of the MCMC algorithm for the maximum of the dates included in the oldest phase

Phase2Min_chain

numeric vector containing the output of the MCMC algorithm for the minimum of the dates included in the youngest phase

Phase2Max_chain

numeric vector containing the output of the MCMC algorithm for the maximum of the dates included in the youngest phase

level

probability corresponding to the level of confidence

title

title of the graph

GridLength

length of the grid used to estimate the density

Details

Curves represent the density of the minimum (oldest dates) and the maximum (youngest dates) of the dates included in each phase. Curves of the same color refer to the same phase. Time range intervals are symbolised by segments above the curves drawn using the same color as the one of the curves of the associated phase. Transition and gap range intervals are represented by two-coloured segments using the colors of the both phases in succession. If the gap between the successive phases does not exist, a cross is drawn instead of a segment.

Value

Plot of the densities of the minimum and the maximum of the dates included in each phase

Author(s)

Anne Philippe <[email protected]> and

Marie-Anne Vibet <[email protected]>

Examples

data(Phases); attach(Phases)
  SuccessionPlot(Phase.1.alpha, Phase.1.beta, Phase.2.alpha, Phase.2.beta, 0.95)

Plot of the activity of events

Description

A statistical graphic designed for the archaeological study of rhythms of the long term that embodies a theory of archaeological evidence for the occurrence of events.

Usage

TempoActivityPlot(data, position, level=0.95,  count = TRUE, 
title = "Activity plot")

Arguments

data

dataframe 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 used for the credible interval

count

if TRUE the counting process is given as a number, otherwise it is a probability

title

title of the graph

Value

It calculates the cumulative frequency of specified events by calculating how many events took place before each date in a specified range of dates.

Author(s)

Anne Philippe <[email protected]>, Thomas S. Dye <[email protected]> and

Marie-Anne Vibet <[email protected]>

References

Dye, T.S. (2016) Long-term rhythms in the development of Hawaiian social stratification. Journal of Archaeological Science, 71, 1–9.

Examples

data(Events); 
  TempoActivityPlot(Events[1:1000,], c(2:5))
  TempoActivityPlot(Events[1:1000,], c(2:5), count = TRUE)

Plot of the occurence of events

Description

A statistical graphic designed for the archaeological study of rhythms of the long term that embodies a theory of archaeological evidence for the occurrence of events.

Usage

TempoPlot(data, position, level=0.95,  count = TRUE, Gauss=FALSE, title = "Tempo plot")

Arguments

data

dataframe 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 used for the credible interval

count

if TRUE the counting process is given as a number, otherwise it is a probability

Gauss

if TRUE, the Gaussian approximation of the CI is used

title

title of the graph

Value

It calculates the cumulative frequency of specified events by calculating how many events took place before each date in a specified range of dates.

Author(s)

Anne Philippe <[email protected]>, Thomas S. Dye <[email protected]> and

Marie-Anne Vibet <[email protected]>

References

Dye, T.S. (2016) Long-term rhythms in the development of Hawaiian social stratification. Journal of Archaeological Science, 71, 1–9.

Examples

data(Events); 
  TempoPlot(Events[1:1000,], c(2:5))
  TempoPlot(Events[1:1000,], c(2:5), count = TRUE)