estimateSNR: computes the signal-to-noise ratio

View source: R/estimateSNR.R

estimateSNRR Documentation

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)    

sharpeRratio documentation built on July 5, 2022, 5:14 p.m.