calc_act_r: Calculate the auto-correlation time using only R. Consider...

View source: R/calc_act.R

calc_act_rR Documentation

Calculate the auto-correlation time using only R. Consider using calc_act instead, as it is orders of magnitude faster

Description

Calculate the auto-correlation time using only R. Consider using calc_act instead, as it is orders of magnitude faster

Usage

calc_act_r(trace, sample_interval)

Arguments

trace

the values

sample_interval

the interval in timesteps between samples

Value

the auto correlation time

Author(s)

The original Java version of the algorithm was from Remco Bouckaert, ported to R and adapted by Richèl J.C. Bilderbeek

See Also

Java code can be found here: https://github.com/CompEvol/beast2/blob/9f040ed0357c4b946ea276a481a4c654ad4fff36/src/beast/core/util/ESS.java#L161 # nolint URLs can be long

Examples

trace <- sin(seq(from = 0.0, to = 2.0 * pi, length.out = 100))
calc_act_r(trace = trace, sample_interval = 1) # 38.18202

ropensci/tracerer documentation built on Oct. 1, 2023, 2:03 p.m.