PBO: Probability of Backtest Overfitting

View source: R/probBO.R

PBOR Documentation

Probability of Backtest Overfitting

Description

Estimate probability of backtest overfitting, as described in Bailey et al. 2017

Usage

PBO(M, s = 12, fun = colMeans,
    threshold = 0, ..., loop.fun = TRUE)

Arguments

M

a numeric matrix

s

number of submatrices

fun

a function

threshold

a scalar

...

additional arguments passed to fun

loop.fun

logical: if TRUE, fun is called separately for every column of M; if FALSE, fun will be passed the whole matrix M

Details

fun is called with M as its first argument.

Value

A list:

pbo

probability

lambda

vector of logits

in.sample

numeric

out.of.sample

numeric

Author(s)

Enrico Schumann

References

Bailey, D. H. et al. (2017). The probability of backtest overfitting. Journal of Computational Finance 20 (4), 39–69. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.21314/JCF.2016.322")}

Examples


## might run a few seconds
N <- 5000
T <- 480
M <- array(rnorm(N*T, sd = 0.01), dim = c(T, N))
p <- PBO(M, s = 12, fun = colMeans, loop.fun = FALSE)
str(p)


NMOF documentation built on Nov. 5, 2025, 6:38 p.m.