stpn | R Documentation |
Density, distribution function and random generation for the slash truncated positive normal (stpn) discussed in Gomez, Gallardo and Santoro (2021).
dstpn(x, sigma, lambda, q, log = FALSE)
pstpn(x, sigma, lambda, q, lower.tail=TRUE, log=FALSE)
rstpn(n, sigma, lambda, q)
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]. |
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.
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.
Gallardo, D.I. and Gomez, H.J.
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.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.