Skip to contents

ledgr_k_ratio() computes the Kestner (2013) K-Ratio over each candidate in a return panel. It uses compounded period returns, fits a linear trend to cumulative log wealth, and applies the published observation-count and periodicity adjustment. The result is evidence only: it does not select, promote, filter, or change walk-forward identity.

Usage

ledgr_k_ratio(
  x,
  periods_per_year = NULL,
  candidates = NULL,
  risk_free_return = 0
)

Arguments

x

A ledgr_return_panel object or a ledgr_sweep_results object with retained completed returns.

periods_per_year

Finite positive numeric scalar giving the expected number of return observations in one calendar year. Supply this explicitly; ledgr does not infer annualization from optional panel labels.

candidates

Optional character vector of candidate ids to include.

risk_free_return

Finite scalar per-period risk-free return to subtract before compounding. It must be greater than -1. The default is zero.

Value

A ledgr_k_ratio object with summary and metadata. Use as_tibble(x) for programmatic access.

See also

vignette("selection-integrity", package = "ledgr") or system.file("doc", "selection-integrity.html", package = "ledgr").

Examples

returns <- data.frame(
  steady = c(0.010, 0.011, 0.009, 0.012),
  uneven = c(0.040, -0.030, 0.020, -0.015)
)
result <- ledgr_k_ratio(ledgr_return_panel(returns), periods_per_year = 12)
tibble::as_tibble(result)
#> # A tibble: 2 × 17
#>   diagnostic schema_version source panel_hash sweep_id candidate_id observations
#>   <chr>               <int> <chr>  <chr>      <chr>    <chr>               <int>
#> 1 k_ratio                 1 user_… 2e2d122d9… NA       steady                  4
#> 2 k_ratio                 1 user_… 2e2d122d9… NA       uneven                  4
#> # ℹ 10 more variables: periods_per_year <dbl>, risk_free_return <dbl>,
#> #   cumulative_log_return <dbl>, slope <dbl>, slope_std_error <dbl>,
#> #   raw_k_ratio <dbl>, k_ratio <dbl>, value <chr>, first_row_dropped <lgl>,
#> #   complete_panel <lgl>