Density function, distribution function, quantile function, random generation.
dtsal(x, shape=1, scale=1, q=tsal.q.from.shape(shape),
kappa=tsal.kappa.from.ss(shape,scale),
log=FALSE)ptsal(x, shape=1, scale=1, q=tsal.q.from.shape(shape),
kappa=tsal.kappa.from.ss(shape,scale),
lower.tail=TRUE, log.p=FALSE)
qtsal(p, shape=1, scale=1, q=tsal.q.from.shape(shape),
kappa=tsal.kappa.from.ss(shape,scale),
lower.tail=TRUE, log.p=FALSE)
rtsal(n, shape=1, scale=1, q=tsal.q.from.shape(shape),
kappa=tsal.kappa.from.ss(shape,scale))
tsal.mean(shape, scale, q=tsal.q.from.shape(shape),
kappa=tsal.kappa.from.ss(shape,scale))
dtsal
gives the density,
ptsal
gives the distribution function,
qtsal
gives the quantile function, and
rtsal
generates random deviates.
tsal.mean
computes the expected value.
The length of the result is determined by n
for
rtsal
, and is the maximum of the lengths of the
numerical parameters for the other functions.
vector of quantiles.
vector of quantiles or a shape parameter.
vector of probabilities.
number of observations. If length(n) > 1
, the length
is taken to be the number required.
shape parameter.
scale parameters.
logical; if TRUE, probabilities p are given as log(p).
logical; if TRUE (default), probabilities are \(P[X \le x]\), otherwise, \(P[X > x]\).
Cosma Shalizi (original R code), Christophe Dutang (R packaging)
The Tsallis distribution is defined by the following density $$ f(x) = \frac{1}{ \kappa}(1-(1-q)x/\kappa)^{1/(1-q)} $$ for all \(x\). It is convenient to introduce a re-parameterization \(shape = -1/(1-q)\), \(scale = shape*\kappa\) which makes the relationship to the Pareto clearer, and eases estimation. If we have both shape/scale and q/kappa parameters, the latter over-ride.
Maximum Likelihood Estimation for q-Exponential (Tsallis) Distributions, C. Shalizi, http://bactra.org/research/tsallis-MLE/ and arxiv.org: 0701854.
#####
# (1) density function
x <- seq(0, 5, length=24)
cbind(x, dtsal(x, 1/2, 1/4))
#####
# (2) distribution function
cbind(x, ptsal(x, 1/2, 1/4))
Run the code above in your browser using DataLab