Learn R Programming

tpn (version 1.8)

fts: Flexible truncated positive normal

Description

Density, distribution function and random generation for the flexible truncated positive (ftp) class discussed in Gomez et al. (2022).

Usage

dfts(x, sigma, lambda, dist="norm", log = FALSE)
pfts(x, sigma, lambda, dist="norm", lower.tail=TRUE, log.p=FALSE)
qfts(p, sigma, lambda, dist="norm")
rfts(n, sigma, lambda, dist="norm")

Value

dfts gives the density, pfts gives the distribution function, qfts gives the quantile function and rfts generates random deviates.

The length of the result is determined by n for rbtpn, 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 fts distribution with parameters \(\sigma>0\) and \(\lambda \in\) R if its probability density function can be written as $$ f(y; \sigma, \lambda, q) = \frac{g_0(\frac{y}{\sigma}-\lambda)}{\sigma G_0(\lambda)}, y>0, $$

where \(g_0(\cdot)\) and \(G_0(\cdot)\) denote the pdf and cdf for the specified distribution. The case where \(g_0(\cdot)\) and \(G_0(\cdot)\) are from the standard normal model is known as the truncated positive normal model discussed in Gomez et al. (2018).

Arguments

x

vector of quantiles

p

vector of probabilities

n

number of observations

sigma

scale parameter for the distribution

lambda

shape parameter for the distribution

dist

standard symmetrical distribution. Avaliable options: norm (default), logis, cauchy and laplace.

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

Author

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

Details

Random generation is based on the inverse transformation method.

References

Gomez, H.J., Gomez, H.W., Santoro, K.I., Venegas, O., Gallardo, D.I. (2022). A Family of Truncation Positive Distributions. Submitted.

Gomez, H.J., Olmos, N.M., Varela, H., Bolfarine, H. (2018). Inference for a truncated positive normal distribution. Applied Mathemetical Journal of Chinese Universities, 33, 163-176.

Examples

Run this code
dfts(c(1,2), sigma=1, lambda=1, dist="logis")
pfts(c(1,2), sigma=1, lambda=1, dist="logis")
rfts(n=10, sigma=1, lambda=1, dist="logis")

Run the code above in your browser using DataLab