Package 'sharpeRratio'

Title: Moment-Free Estimation of Sharpe Ratios
Description: An efficient moment-free estimator of the Sharpe ratio, or signal-to-noise ratio, for heavy-tailed data (see <arXiv:1505.01333>).
Authors: Damien Challet
Maintainer: Damien Challet <[email protected]>
License: GPL
Version: 1.4.3
Built: 2025-02-05 03:09:39 UTC
Source: https://github.com/cran/sharpeRratio

Help Index


A moment-free estimator of the Sharpe (signal-to-noise) ratio

Description

This package implements a new estimator of Sharpe ratios that does not rely on the computation of any moment, despite the fact that its usual definition involves at least the first two moments (average and standard deviation).

Details

An implementation of an alternative method to measure Sharpe ratios, i.e. signal-to-noise ratios in time series with heavy-tailed increments. The method itself does not require the computation of any moment as it is based on counting the number of records of the cumulative sum of the increments. When increments are known to be Gaussian, the usual estimator has to be used. However, when the increments are heavy-tailed, the new estimator is more precise (efficient). Note that the increments are assumed to be i.i.d. Note also that the new estimator is almost as efficient as the usual Sharpe ratio for Gaussian variables.

Author(s)

Damien Challet Maintainer: Damien Challet

References

Challet, D. (2017). Sharper asset ranking from total drawdown durations. Applied Mathematical Finance, 24(1), 1-22.


A pre-calibrated spline function needed to translate the number of upper/lower records in to signa-to-noise ratios.

Description

This function is needed to translate the number of records to Sharpe ratios. There should not be any need to use directly this function.

See Also

estimateSNR


Computes the average difference between the number of upper and lower records of the cumulative sum of the sample values.

Description

Computes the average difference between the number of upper and lower records of the cumulative sum of the sample values.

Usage

computeR0bar(x, numPerm = 100L, q1 = 0.025, q2 = 0.975)

Arguments

x

a vector of sample values

numPerm

the number of random permutations (or shuffles) of the sample value order

q1

a real number for computing the lower confidence interval

q2

a real number for computing the upper confidence interval

Value

a list

  • mean the average difference of upper and lower records of the cumulative sum of x

  • q1 the q1 quantile of the difference

  • q1 the q2 quantile of the difference


computes the signal-to-noise ratio

Description

computes the signal-to-noise ratio

Usage

estimateSNR(x, numPerm = NA, nu = NA, quantiles = c(0.05, 0.95))

Arguments

x

A (non-empty) numeric vector of data values.

numPerm

The number of permutations (or shuffling) of the order of the sample values. By default set to min(100,3 log(length(x))).

nu

the Student t-distribution tail exponent of the sample data (if know). By default: NA. If set to NA, the tail exponent of the data is obtained from fit to a Student t-distribution. If NA, nu is estimated.

quantiles

a vector of the lower and upper quantile needed to compute the confidence interval (use only if nu is known).

Value

a list element

  • SNR The signal-to-noise ratio. To have something comparable with a t-statistics, multiply by sqrt(length(x)). To have a Sharpe ratio, multiply by the correct factor (sqrt(252)) for daily returns)

  • SNR.ci The 95

  • nu The fitted Student t-distribution tail exponent.

  • R0bar The number of upper records minus the number of lower records of the cumulated sum of x.

  • N The length of the vector x. It may be smaller than the input length if x contains NAs.

Examples

x <- rt(100,3)/sqrt(3)+0.05  #some Student-t distributed synthetic price log-returns
  estimateSNR(x)

A pre-calibrated spline function needed to translate the number of upper/lower records in to signa-to-noise ratios.

Description

This function is needed to translate the number of records to Sharpe ratios. There should not be any need to use directly this function.

See Also

estimateSNR


Computes the number of lower records of the cumulative sum of x

Description

Computes the number of lower records of the cumulative sum of x

Usage

num_records_down(x)

Arguments

x

a vector of sample values

Value

the number of lower records


Computes the number of upper records of the cumulative sum of x

Description

Computes the number of upper records of the cumulative sum of x

Usage

num_records_up(x)

Arguments

x

a vector of sample values

Value

the number of upper records