calc_esses: Calculates the Effective Sample Sizes from a parsed BEAST2...

Description Usage Arguments Value Author(s) Examples

Description

Calculates the Effective Sample Sizes from a parsed BEAST2 log file

Usage

1
calc_esses(traces, sample_interval)

Arguments

traces

a dataframe with traces with removed burn-in

sample_interval

the interval in timesteps between samples

Value

the effective sample sizes

Author(s)

Richel J.C. Bilderbeek

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
  # Obtain an example log file its name
  filename <- system.file(
    "extdata", "beast2_example_output.log", package = "RBeast"
  )

  # Parse that log file
  beast_log_full <- parse_beast_log(filename = filename)

  # Remove the burn-in
  beast_log <- remove_burn_ins(
    beast_log_full,
    burn_in_fraction = 0.1
  )

  # Calculates the effective sample sizes of all parameter estimates
  esses <- calc_esses(beast_log, sample_interval = 1000)

  # Round off values to nearest integers
  esses <- as.integer(esses[1, ] + 0.5)
  expected <- c(10, 10, 10, 10, 7, 10, 9, 6)
  testit::assert(all(esses == expected))

beast-dev/RBeast documentation built on May 12, 2019, 10:02 a.m.