rCTS {TempStable}R Documentation

Function to generate random variates of CTS distribution.

Description

Generates n random numbers distributed according to the classical tempered stable (CTS) distribution.

Usage

rCTS(
  n,
  alpha = NULL,
  deltap = NULL,
  deltam = NULL,
  lambdap = NULL,
  lambdam = NULL,
  mu = NULL,
  theta = NULL,
  methodR = "TM",
  k = 10000,
  c = 1
)

Arguments

n

sample size (integer).

alpha

Stability parameter. A real number between 0 and 2.

deltap

Scale parameter for the right tail. A real number > 0.

deltam

Scale parameter for the left tail. A real number > 0.

lambdap

Tempering parameter for the right tail. A real number > 0.

lambdam

Tempering parameter for the left tail. A real number > 0.

mu

A location parameter, any real number.

theta

Parameters stacked as a vector.

methodR

A String. Either "TM","AR" or "SR".

k

integer: the level of truncation, if methodR == "SR". 10000 by default.

c

A real number. Only relevant for methodR == "AR". 1 by default.

Details

theta denotes the parameter vector (alpha, deltap, deltam, lambdap, lambdam, mu). Either provide the parameters individually OR provide theta. "AR" stands for the approximate 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. "TM" works only for alpha < 1. In this method the function copula::retstable() is called. For alpha < 1, "TM" is the default method, while "AR" for alpha > 1 is the default method.

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 of the CTS distribution.

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

copula::retstable() as "TM" uses this function.

Examples

rCTS(10,0.5,1,1,1,1,1,NULL,"SR",10)
rCTS(10,0.5,1,1,1,1,1,NULL,"aAR")


[Package TempStable version 0.2.2 Index]