Learn R Programming

SharpeR (version 1.4.0)

plambdap: The lambda-prime distribution.

Description

Distribution function and quantile function for LeCoutre's lambda-prime distribution with df degrees of freedom and the observed t-statistic, tstat.

Usage

plambdap(q, df, tstat, lower.tail = TRUE, log.p = FALSE)

qlambdap(p, df, tstat, lower.tail = TRUE, log.p = FALSE)

rlambdap(n, df, tstat)

Value

dlambdap gives the density, plambdap gives the distribution function, qlambdap gives the quantile function, and rlambdap generates random deviates.

Invalid arguments will result in return value NaN with a warning.

Arguments

q

vector of quantiles.

df

the degrees of freedom of the t-statistic.

tstat

the observed (non-central) t-statistic.

lower.tail

logical; if TRUE (default), probabilities are \(P[X \le x]\), otherwise, \(P[X > x]\).

log.p

logical; if TRUE, probabilities p are given as \(\mbox{log}(p)\).

p

vector of probabilities.

n

number of observations. If 'length(n) > 1', the length is taken to be the number required.

Author

Steven E. Pav shabbychef@gmail.com

Details

Let \(t\) be distributed as a non-central t with \(\nu\) degrees of freedom and non-centrality parameter \(\delta\). We can view this as $$t = \frac{Z + \delta}{\sqrt{V/\nu}}.$$ where \(Z\) is a standard normal, \(\delta\) is the non-centrality parameter, \(V\) is a chi-square RV with \(\nu\) degrees of freedom, independent of \(Z\). We can rewrite this as $$\delta = t\sqrt{V/\nu} + Z.$$

Thus a 'lambda-prime' random variable with parameters \(t\) and \(\nu\) is one expressable as a sum $$t\sqrt{V/\nu} + Z$$ for Chi-square \(V\) with \(\nu\) d.f., independent from standard normal \(Z\)

See ‘The Sharpe Ratio: Statistics and Applications’, section 2.4.

References

Pav, S. E. "The Sharpe Ratio: Statistics and Applications." CRC Press, 2021.

Lecoutre, Bruno. "Another look at confidence intervals for the noncentral t distribution." Journal of Modern Applied Statistical Methods 6, no. 1 (2007): 107--116. https://eris62.eu/telechargements/Lecoutre_Another_look-JMSAM2007_6(1).pdf

Lecoutre, Bruno. "Two useful distributions for Bayesian predictive procedures under normal models." Journal of Statistical Planning and Inference 79 (1999): 93--105.

See Also

t-distribution functions, dt,pt,qt,rt

Other sr: as.sr(), confint.sr(), dsr(), is.sr(), power.sr_test(), predint(), print.sr(), reannualize(), se(), sr, sr_equality_test(), sr_test(), sr_unpaired_test(), sr_vcov(), summary.sr

Examples

Run this code
rvs <- rnorm(128)
pvs <- plambdap(rvs, 253*6, 0.5)
plot(ecdf(pvs))
pvs <- plambdap(rvs, 253*6, 1)
plot(ecdf(pvs))
pvs <- plambdap(rvs, 253*6, -0.5)
plot(ecdf(pvs))
# test vectorization:
qv <- qlambdap(0.1,128,2)
qv <- qlambdap(c(0.1),128,2)
qv <- qlambdap(c(0.2),128,2)
qv <- qlambdap(c(0.2),253,2)
qv <- qlambdap(c(0.1,0.2),128,2)
qv <- qlambdap(c(0.1,0.2),c(128,253),2)
qv <- qlambdap(c(0.1,0.2),c(128,253),c(2,4))
qv <- qlambdap(c(0.1,0.2),c(128,253),c(2,4,8,16))
# random generation
rv <- rlambdap(1000,252,2)

Run the code above in your browser using DataLab