rNTS {TempStable} | R Documentation |
Function to generate random variates of NTS distribution.
Description
Generates n
random numbers distributed according
of the normal tempered stable distribution.
Usage
rNTS(
n,
alpha = NULL,
beta = NULL,
delta = NULL,
lambda = NULL,
mu = NULL,
theta = NULL,
methodR = "TM",
k = 10000
)
Arguments
n |
sample size (integer). |
alpha |
A real number between 0 and 1. |
beta |
A gap holder. |
delta |
A real number > 0. |
lambda |
A real number > 0. |
mu |
A location parameter, any real number. |
theta |
A vector of all other arguments. |
methodR |
A String. Either "TM","AR" or "SR". "TM" by default. |
k |
integer: the number of replications, if |
Details
theta
denotes the parameter vector (alpha, beta, delta, lambda,
mu)
. Either provide the parameters individually OR provide theta
.
Works by a normal variance-mean mixture with a TSS distribution. Method
parameter is for the method of simulating the TSS random variable, see the
rTSS()
function.
"AR" stands for the Acceptance-Rejection Method and "SR" for a truncated
infinite shot noise series representation. "TM" stands for Two Methods as
two different methods are used depending on which will be faster. In this
method the function copula::retstable()
is called. "TM" is the standard
method used. For more details, see references.
It is recommended to check the generated random numbers once for each distribution using the density function. If the random numbers are shifted, e.g. for the method "SR", it may be worthwhile to increase k.
For more details, see references.
Value
Generates n
random numbers.
References
Massing, T. (2023), 'Parametric Estimation of Tempered Stable Laws'
Kawai, R & Masuda, H (2011), 'On simulation of tempered stable random variates' doi:10.1016/j.cam.2010.12.014
Hofert, M (2011), 'Sampling Exponentially Tilted Stable Distributions' doi:10.1145/2043635.2043638
See Also
See also the rTSS()
function.
copula::retstable()
as "TM" uses this function.
Examples
rNTS(100, 0.5, 1,1,1,1)
rNTS(10, 0.6, 0,1,1,0)
rNTS(10, 0.5, 1,1,1,1, NULL, "SR", 100)