stpn: Slash truncated positive normal

stpnR Documentation

Slash truncated positive normal

Description

Density, distribution function and random generation for the slash truncated positive normal (stpn) discussed in Gomez, Gallardo and Santoro (2021).

Usage

dstpn(x, sigma, lambda, q, log = FALSE)
pstpn(x, sigma, lambda, q, lower.tail=TRUE, log=FALSE)
rstpn(n, sigma, lambda, q)

Arguments

x

vector of quantiles

n

number of observations

sigma

scale parameter for the distribution

lambda

shape parameter for the distribution

q

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

Details

Random generation is based on the stochastic representation of the model, i.e., the quotient between a tpn (see Gomez et al. 2018) and a beta random variable.

Value

dstpn gives the density, pstpn gives the distribution function and rstpn generates random deviates.

The length of the result is determined by n for rstpn, 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 has stpn distribution with parameters \sigma>0, \lambda \in R and q>0 if its probability density function can be written as

f(y; \sigma, \lambda, q) = \int_0^1 t^{1/q} \sigma \phi(y t^{1/q} \sigma-\lambda)dt, y>0,

where \phi(\cdot) denotes the density function for the standard normal distribution.

Author(s)

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

References

Gomez, H., Gallardo, D.I., Santoro, K. (2021) Slash Truncation Positive Normal Distribution: with application using the EM algorithm. Symmetry, 13, 2164.

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

dstpn(c(1,2), sigma=1, lambda=-1, q=2)
pstpn(c(1,2), sigma=1, lambda=-1, q=2)
rstpn(n=10, sigma=1, lambda=-1, q=2)

tpn documentation built on Sept. 28, 2023, 1:06 a.m.

Related to stpn in tpn...