Learn R Programming

RChronoModel (version 0.1)

MultiPhaseTimeRange: Phase Time Range for multiple phases

Description

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

Usage

MultiPhaseTimeRange(file, position, level = 0.95, max_decimal = 0,
dec = '.', sep=',', comment.char='#')

Arguments

file
name of the CSV file containing the output of the MCMC algorithm of all pahses of interest
position
numeric vector containing the position of the beginning of the phases of interest in the CSV file
level
probability corresponding to the desired level of confidence
max_decimal
maximum number of decimal
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()

Value

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

Examples

Run this code
data(Phases)
  write.csv(Phases, "data.csv")
  MultiPhaseTimeRange("data.csv", c(4,2), 0.95, 0)

Run the code above in your browser using DataLab