Learn R Programming

sadists (version 0.2.2)

upsilon: The upsilon distribution.

Description

Density, distribution function, quantile function and random generation for the upsilon distribution.

Usage

dupsilon(x, df, t, log = FALSE, order.max=6)
pupsilon(q, df, t, lower.tail = TRUE, log.p = FALSE, order.max=6)
qupsilon(p, df, t, lower.tail = TRUE, log.p = FALSE, order.max=6)
rupsilon(n, df, t)

Arguments

x, q
vector of quantiles.
df
the degrees of freedom in the chi square. a vector. we do not vectorize over this variable.
t
the scaling parameter on the chi. a vector. should be the same length as df. we do not vectorize over this variable.
log
logical; if TRUE, densities $f$ are given as $log(f)$.
order.max
the order to use in the approximate density, distribution, and quantile computations, via the Gram-Charlier, Edeworth, or Cornish-Fisher expansion.
p
vector of probabilities.
n
number of observations.
log.p
logical; if TRUE, probabilities p are given as $log(p)$.
lower.tail
logical; if TRUE (default), probabilities are $P[X <= x]$,="" otherwise,="" $p[x=""> x]$.

Value

dupsilon gives the density, pupsilon gives the distribution function, qupsilon gives the quantile function, and rupsilon generates random deviates.Invalid arguments will result in return value NaN with a warning.

Details

Suppose $x_i ~ X^2(v_i)$ independently and independently of $Z$, a standard normal. Then $$\Upsilon = Z + \sum_i t_i \sqrt{x_i/\nu_i}$$ takes an upsilon distribution with parameter vectors $, $.

The upsilon distribution is used in certain tests of the Sharpe ratio for independent observations, and generalizes the lambda prime distribution, which can be written as $Z + t sqrt(x/v)$.

References

Lecoutre, Bruno. "Another look at confidence intervals for the noncentral t distribution." Journal of Modern Applied Statistical Methods 6, no. 1 (2007): 107--116. http://www.univ-rouen.fr/LMRS/Persopage/Lecoutre/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.

Pav, Steven. "Inference on the Sharpe ratio via the upsilon distribution.' Arxiv (2015). http://arxiv.org/abs/1505.00829

See Also

lambda-prime distribution functions, dlambdap, plambdap, qlambdap, rlambdap. Sum of chi-squares to power distribution functions, dsumchisqpow, psumchisqpow, qsumchisqpow, rsumchisqpow.

Examples

Run this code
mydf <- c(100,30,50)
myt <- c(-1,3,5)
rv <- rupsilon(500, df=mydf, t=myt)
d1 <- dupsilon(rv, df=mydf, t=myt)
## Not run: 
# plot(rv,d1)
# ## End(Not run)
p1 <- pupsilon(rv, df=mydf, t=myt)
# should be nearly uniform:
## Not run: 
# plot(ecdf(p1))
# ## End(Not run)
q1 <- qupsilon(ppoints(length(rv)),df=mydf,t=myt)
## Not run: 
# qqplot(x=rv,y=q1)
# ## End(Not run)
## Not run: 
# require(SharpeR)
# ope <- 252
# n.sim <- 500
# n.term <- 3
# set.seed(234234)
# pp <- replicate(n.sim,{
#   # these are population parameters 
#   a <- rnorm(n.term) 
#   psi <- 6 * rnorm(length(a)) / sqrt(ope)
#   b <- sum(a * psi)
#   df <- 100 + ceiling(200 * runif(length(psi)))
#   comm <- 1 / sqrt(sum(a^2 / df))
#   cdf <- df - 1
#   # now independent draws from the SR distribution:
#   x <- rsr(length(df), df, zeta=psi, ope=1)
#   # now compute a p-value under the true null
#   pupsilon(comm * b,df=cdf,t=comm*a*x) 
#   })
# # ought to be uniform:
# plot(ecdf(pp)) 
# ## End(Not run)

Run the code above in your browser using DataLab