Learn R Programming

tpn (version 1.10)

tpt: Truncated positive t

Description

Density, distribution function and random generation for the slash truncated positive student-t (tpt) distribution.

Usage

dtpt(x, sigma, lambda, nu, log = FALSE)
ptpt(x, sigma, lambda, nu, lower.tail=TRUE, log=FALSE)
rtpt(n, sigma, lambda, nu)

Value

dtpt gives the density, ptpt gives the distribution function and rtpt generates random deviates.

The length of the result is determined by n for rtpt, and is the maximum of the lengths of the numerical arguments for the other functions.

The numerical arguments other than n are recycled to the length of the result. Only the first elements of the logical arguments are used.

A variable have tpt distribution with parameters \(\sigma>0\), \(\lambda \in\) R and \(\nu>0\) if its probability density function can be written as $$ f(y; \sigma, \lambda, q) = \frac{t_\nu\left(\frac{y}{\sigma}-\lambda\right)}{\sigma T_\nu(\lambda)}, y>0, $$

where \(t_\nu(\cdot)\) and \(T_\nu(\cdot)\) denote the density and cumultative distribution functions for the standard t distribution with \(\nu\) degrees of freedom.

Arguments

x

vector of quantiles

n

number of observations

sigma

scale parameter for the distribution

lambda

shape parameter for the distribution

nu

nu parameter for the distribution

log

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].

Author

Gallardo, D.I. and Gomez, H.J.

Details

Random generation is based on the inverse transformation method.

Examples

Run this code
dtpt(c(1,2), sigma=1, lambda=-1, nu=5)
ptpt(c(1,2), sigma=1, lambda=-1, nu=5)
rtpt(n=10, sigma=1, lambda=-1, nu=5)

Run the code above in your browser using DataLab