Description Usage Arguments Details Value Note Author(s) References See Also Examples
View source: R/distributions.r
Distribution function and quantile function for LeCoutre's
lambda-prime distribution with df
degrees of freedom
and the observed t-statistic, tstat
.
1 2 3 4 5 |
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 <= x], otherwise, P[X > x]. |
log.p |
logical; if TRUE, probabilities p are given as log(p). |
p |
vector of probabilities. |
n |
number of observations. If 'length(n) > 1', the length is taken to be the number required. |
Let t be distributed as a non-central t with v degrees of freedom and non-centrality parameter ncp. We can view this as
t = (Z + ncp)/sqrt(V/v)
where Z is a standard normal, ncp is the non-centrality parameter, V is a chi-square RV with v degrees of freedom, independent of Z. We can rewrite this as
ncp = t sqrt(V/v) + Z
Thus a 'lambda-prime' random variable with parameters t and v is one expressable as a sum
t sqrt(V/v) + Z
for Chi-square V with v d.f., independent from standard normal Z
See ‘The Sharpe Ratio: Statistics and Applications’, section 2.4.
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.
plambdap
should be an increasing function of the argument q
,
and decreasing in tstat
. qlambdap
should be increasing
in p
Steven E. Pav shabbychef@gmail.com
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.
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_equality_test()
,
sr_test()
,
sr_unpaired_test()
,
sr_vcov()
,
sr
,
summary.sr
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.