Title: | Positive Tempered Stable Distributions and Related Subordinators |
---|---|
Description: | Contains methods for the simulation of positive tempered stable distributions and related subordinators. Including classical tempered stable, rapidly deceasing tempered stable, truncated stable, truncated tempered stable, generalized Dickman, truncated gamma, generalized gamma, and p-gamma. For details, see Dassios et al (2019) <doi:10.1017/jpr.2019.6>, Dassios et al (2020) <doi:10.1145/3368088>, Grabchak (2021) <doi:10.1016/j.spl.2020.109015>. |
Authors: | Michael Grabchak [aut, cre], Lijuan Can [aut] |
Maintainer: | Michael Grabchak <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.0 |
Built: | 2025-02-23 05:47:25 UTC |
Source: | https://github.com/cran/SubTS |
Contains methods for the simulation of positive tempered stable distributions and related subordinators. Including classical tempered stable, rapidly deceasing tempered stable, truncated stable, truncated tempered stable, generalized Dickman, truncated gamma, generalized gamma, and p-gamma. For details, see Dassios et al (2019) <doi:10.1017/jpr.2019.6>, Dassios et al (2020) <doi:10.1145/3368088>, Grabchak (2021) <doi:10.1016/j.spl.2020.109015>.
The DESCRIPTION file:
Package: | SubTS |
Type: | Package |
Title: | Positive Tempered Stable Distributions and Related Subordinators |
Version: | 1.0 |
Date: | 2023-02-04 |
Authors@R: | c(person("Michael", "Grabchak", role = c("aut", "cre"), email = "[email protected]"), person("Lijuan", "Can", role = "aut") ) |
Description: | Contains methods for the simulation of positive tempered stable distributions and related subordinators. Including classical tempered stable, rapidly deceasing tempered stable, truncated stable, truncated tempered stable, generalized Dickman, truncated gamma, generalized gamma, and p-gamma. For details, see Dassios et al (2019) <doi:10.1017/jpr.2019.6>, Dassios et al (2020) <doi:10.1145/3368088>, Grabchak (2021) <doi:10.1016/j.spl.2020.109015>. |
Suggests: | statmod |
Imports: | copula, gsl, stats, tweedie |
License: | GPL (>= 3) |
NeedsCompilation: | yes |
Packaged: | 2023-02-17 00:40:03 UTC; lcao2 |
Author: | Michael Grabchak [aut, cre], Lijuan Can [aut] |
Maintainer: | Michael Grabchak <[email protected]> |
Date/Publication: | 2023-02-17 10:00:12 UTC |
Config/pak/sysreqs: | libgsl0-dev |
Repository: | https://michaelg-1.r-universe.dev |
RemoteUrl: | https://github.com/cran/SubTS |
RemoteRef: | HEAD |
RemoteSha: | 446bad017ac161bb0fd025080a0864809ffa9646 |
Index of help topics:
SubTS-package Positive Tempered Stable Distributions and Related Subordinators dF1 Pdf for f_1 dF2 Pdf for f_2 dGGa Pdf of the generalized gamma distribution dSubCTS PDF of CTS subordinator getk1 Constant K_1 getk2 Constant K_2 rDickman Simulation from the generalized Dickman distribution rF1 Simulation from f_1 rF2 Simulation from f_2 rGGa Simulates from the generalized gamma distribution rPGamma Simulation from p-gamma distributions. rPRDTS Simulation from p-RDTS distributions. rSubCTS Simulates of CTS subordinators rTrunGamma Simulation from the truncated gamma distribution rTrunS Simulation from the truncated stable distribution rTrunTS Simulation from the truncated tempered stable distribution. simCondS Simulation from a conditioned stable distribution. simTandW Simulation of hitting time and overshoot.
Michael Grabchak [aut, cre], Lijuan Can [aut]
Maintainer: Michael Grabchak <[email protected]>
A. Dassios, Y. Qu, J.W. Lim (2019). Exact simulation of generalised Vervaat perpetuities. Journal of Applied Probability, 56(1):57-75.
A. Dassios, Y. Qu, J.W. Lim (2020). Exact simulation of a truncated Levy subordinator. ACM Transactions on Modeling and Computer Simulation, 30(10), 17.
M. Grabchak (2016). Tempered Stable Distributions: Stochastic Models for Multiscale Processes. Springer, Cham.
M. Grabchak (2021). An exact method for simulating rapidly decreasing tempered stable distributions. Statistics and Probability Letters, 170: Article 109015.
rPRDTS(20, 2, 1, .7, 2) rPRDTS(20, 2, 1, 0, 2) rPRDTS(20, 2, 1, -.7, 2) rDickman(10, 1) rTrunGamma(10, 2, 1) rPGamma(20, 2, 2, 2) rTrunS(10, 2, .6) rTrunTS(10, 2, 2, .6)
rPRDTS(20, 2, 1, .7, 2) rPRDTS(20, 2, 1, 0, 2) rPRDTS(20, 2, 1, -.7, 2) rDickman(10, 1) rTrunGamma(10, 2, 1) rPGamma(20, 2, 2, 2) rTrunS(10, 2, .6) rTrunTS(10, 2, 2, .6)
Evaluates the pdf f_1(x) intruduced in Grabchak (2021).
dF1(x, a, p)
dF1(x, a, p)
x |
Vector of real numbers. |
a |
Parameter >=0. |
p |
Parameter >1. |
Evaluates the pdf
f_1(x) = exp(-x^p)*x^(-1-a)/K_1, x>1
where K_1 is a normalizing constant. This is distribution is needed to simulate p-RDTS random variables.
Returns a vector of real numbers corresponding to the values of f_1(x).
Michael Grabchak and Lijuan Cao
M. Grabchak (2021). An exact method for simulating rapidly decreasing tempered stable distributions. Statistics and Probability Letters, 170: Article 109015.
x = (10:20)/10 dF1(x, .5, 2)
x = (10:20)/10 dF1(x, .5, 2)
Evaluates the pdf f_2(x) intruduced in Grabchak (2021).
dF2(x, a, p)
dF2(x, a, p)
x |
Vector of real numbers. |
a |
Parameter in [0,1). |
p |
Parameter >1. |
Evaluates the pdf
f_2(x) = (exp(-x^p) - exp(-x))*x^(-1-a)/K_2, 0<x<1
where K_2 is a normalizing constant. This distribution is needed to simulate p-RDTS random variables.
Returns a vector of real numbers corresponding to the values of f_2(x).
Michael Grabchak and Lijuan Cao
M. Grabchak (2021). An exact method for simulating rapidly decreasing tempered stable distributions. Statistics and Probability Letters, 170: Article 109015.
x = (0:10)/10 dF2(x, .5, 1.5)
x = (0:10)/10 dF2(x, .5, 1.5)
Evaluates the pdf of the generalized gamma distribution.
dGGa(x, a, p, b)
dGGa(x, a, p, b)
x |
Vector of real numbers. |
a |
Parameter >0. |
p |
Parameter >0. |
b |
Parameter >0. |
Evaluates the pdf of the generalized gamma distribution with density
g(x) = exp(-b*x^p)*x^(a-1)/K_3, x>0,
where K_3 is a normalizing constant. This distribution is needed to simulate p-RDTS random variables with negative alpha values.
Returns a vector of real numbers corresponding to the values of g(x).
Michael Grabchak and Lijuan Cao
M. Grabchak (2021). An exact method for simulating rapidly decreasing tempered stable distributions. Statistics and Probability Letters, 170: Article 109015.
E.W. Stacy (1962) A generalization of the gamma distribution. Annals of Mathematical Statistics, 33(3):1187-1192.
x = (0:20)/10 dGGa(x, 2.5, 1.5, 3.1)
x = (0:20)/10 dGGa(x, 2.5, 1.5, 3.1)
Evaluates the pdf of the classical tempered stable (CTS) subordinator. When alpha=0 this is the pdf of the gamma distribution.
dSubCTS(x, alpha, c, ell)
dSubCTS(x, alpha, c, ell)
x |
Vector of real numbers. |
alpha |
Parameter in [0,1). |
c |
Parameter >0 |
ell |
Tempering parameter >0 |
Returns the pdf of a classical tempered stable subordinator. The distribution has Laplace transform
L(z) = exp( c int_0^infty (e^(-xz)-1)e^(-x/ell) x^(-1-alpha) dx), z>0
and Levy measure
M(dx) = c e^(-x/ell) x^(-1-alpha) 1(x>0)dx.
Returns a vector of real numbers corresponding to the values of pdf.
Uses the method dtweedie in the Tweedie package.
Michael Grabchak and Lijuan Cao
M. Grabchak (2016). Tempered Stable Distributions: Stochastic Models for Multiscale Processes. Springer, Cham.
x = (0:20)/10 dSubCTS(x, .5, 1, 1.5)
x = (0:20)/10 dSubCTS(x, .5, 1, 1.5)
Evaluates the constant K_1, which is the normalizing constant for f_1.
getk1(alpha, p)
getk1(alpha, p)
alpha |
Parameter >=0. |
p |
Parameter >1. |
Evaluates
K_1 = int_1^infty exp(-x^p)*x^(-1-alpha) dx.
This is needed to simulate p-RDTS random variables.
Returns a positive real number.
Michael Grabchak and Lijuan Cao
M. Grabchak (2021). An exact method for simulating rapidly decreasing tempered stable distributions. Statistics and Probability Letters, 170: Article 109015.
getk1(1.5,2.5)
getk1(1.5,2.5)
Evaluates the constant K_2, which is the normalizing constant for f_2.
getk2(alpha, p)
getk2(alpha, p)
alpha |
Parameter in [0,1). |
p |
Parameter >1. |
Evaluates
K_2 = int_0^1 ( exp(-x^p) - exp(-x) )*x^(-1-alpha) dx.
This is needed to simulate p-RDTS random variables.
Returns a positive real number.
Michael Grabchak and Lijuan Cao
M. Grabchak (2021). An exact method for simulating rapidly decreasing tempered stable distributions. Statistics and Probability Letters, 170: Article 109015.
getk2(0.5,2.5)
getk2(0.5,2.5)
Simulates from the generalized Dickman distribution using Algorithm 3.1 in Dassios, Qu, and Lim (2019).
rDickman(n, t, b = 1)
rDickman(n, t, b = 1)
n |
Number of observations. |
t |
Parameter > 0. |
b |
Parameter > 0. |
Simulates from the generalized Dickman distribution by using Algorithm 3.1 in Dassios, Qu, and Lim (2019). This distribution has Laplace transform
L(z) = exp( t int_0^b (e^(-xz)-1) x^(-1) dx), z>0
and Levy measure
M(dx) = t x^(-1) 1(0<x<b) dx.
When b=1 and t=1, this is the Dickman distribution.
Returns a vector of n random numbers.
Michael Grabchak and Lijuan Cao
A. Dassios, Y. Qu, J.W. Lim (2019). Exact simulation of generalised Vervaat perpetuities. Journal of Applied Probability, 56(1):57-75.
M. Penrose and A. Wade (2004). Random minimal directed spanning trees and Dickman-type distributions. Advances in Applied Probability, 36(3):691-714.
rDickman(10, 1)
rDickman(10, 1)
Simulates from the pdf f_1(x) intruduced in Grabchak (2021).
rF1(n, a, p)
rF1(n, a, p)
n |
Number of observations. |
a |
Parameter >=0. |
p |
Parameter >1. |
Uses Algorithm 1 in Grabchak (2021) to simulate from the pdf
f_1(x) = exp(-x^p)*x^(-1-a)/K_1, x>1,
where K_1 is a normalizing constant. This is needed to simulate p-RDTS random variables.
Returns a vector of n random numbers.
Michael Grabchak and Lijuan Cao
M. Grabchak (2021). An exact method for simulating rapidly decreasing tempered stable distributions. Statistics and Probability Letters, 170: Article 109015.
rF1(10, .7, 2.5)
rF1(10, .7, 2.5)
Simulates from the pdf f_2(x) intruduced in Grabchak (2021).
rF2(n, a, p)
rF2(n, a, p)
n |
Number of observations. |
a |
Parameter in [0,1). |
p |
Parameter >1. |
Uses Algorithm 2 in Grabchak (2021) to simulate from the pdf
f_2(x) = (exp(-x^p) - exp(-x))*x^(-1-a)/K_2, 0<x<1
where K_2 is a normalizing constant. This is needed to simulate p-RDTS random variables.
Returns a vector of n random numbers.
Michael Grabchak and Lijuan Cao
M. Grabchak (2021). An exact method for simulating rapidly decreasing tempered stable distributions. Statistics and Probability Letters, 170: Article 109015.
rF2(10, .7, 2.5)
rF2(10, .7, 2.5)
Simulates from the generalized gamma distribution.
rGGa(n, a, p, b)
rGGa(n, a, p, b)
n |
Number of observations. |
a |
Parameter >0. |
p |
Parameter >0. |
b |
Parameter >0. |
Simulates from the generalized gamma distribution with density
g(x) = exp(-b*x^p)*x^(a-1)/K_3, x>0,
where K_3 is a normalizing constant. The mathodology is explained in Section 4 of Grabchak (2021). This distribution is needed to simulate p-RDTS random variables with negative alpha values.
Returns a vector of n random numbers.
Michael Grabchak and Lijuan Cao
M. Grabchak (2021). An exact method for simulating rapidly decreasing tempered stable distributions. Statistics and Probability Letters, 170: Article 109015.
E.W. Stacy (1962) A generalization of the gamma distribution. Annals of Mathematical Statistics, 33(3):1187-1192.
rGGa(20, .5, 2, 2)
rGGa(20, .5, 2, 2)
Simulates from p-gamma distributions. These are p-RDTS distributions with alpha=0.
rPGamma(n, t, mu, p, step = 1)
rPGamma(n, t, mu, p, step = 1)
n |
Number of observations. |
t |
Parameter >0. |
mu |
Parameter >0. |
p |
Parameter >1. |
step |
Tuning parameter. The larger the step, the slower the rejection sampling, but the fewer the number of terms. See Hoefert (2011) or Section 4 in Grabchak (2019). |
Uses Theorem 1 in Grabchak (2021) to simulate from a p-Gamma distribution. This distribution has Laplace transform
L(z) = exp( t int_0^infty (e^(-xz)-1)e^(-(mu*x)^p) x^(-1) dx ), z>0
and Levy measure
M(dx) = t e^(-(mu*x)^p) x^(-1) 1(x>0)dx.
Returns a vector of n random numbers.
Michael Grabchak and Lijuan Cao
M. Grabchak (2019). Rejection sampling for tempered Levy processes. Statistics and Computing, 29(3):549-558
M. Grabchak (2021). An exact method for simulating rapidly decreasing tempered stable distributions. Statistics and Probability Letters, 170: Article 109015.
M. Hofert (2011). Sampling exponentially tilted stable distributions. ACM Transactions on Modeling and Computer Simulation, 22(1), 3.
rPGamma(20, 2, 2, 2)
rPGamma(20, 2, 2, 2)
Simulates from p-rapidly decreasing tempered stable (p-RDTS) distributions.
rPRDTS(n, t, mu, alpha, p, step = 1)
rPRDTS(n, t, mu, alpha, p, step = 1)
n |
Number of observations. |
t |
Parameter >0. |
mu |
Parameter >0. |
alpha |
Parameter in (-infty,1) |
p |
Parameter >1 if 0<=alpha<1, >0 if alpha<0. |
step |
Tuning parameter. The larger the step, the slower the rejection sampling, but the fewer the number of terms. See Hoefert (2011) or Section 4 in Grabchak (2019). |
Simulates from a p-RDTS distribution. When alpha >=0, uses Theorem 1 in Grabchak (2021) and when alpha<0 uses the method in Section 4 of Grabchak (2021). This distribution has Laplace transform
L(z) = exp( t int_0^infty (e^(-xz)-1)e^(-(mu*x)^p) x^(-1-alpha) dx ), z>0
and Levy measure
M(dx) = t e^(-(mu*x)^p) x^(-1-alpha) 1(x>0)dx.
Returns a vector of n random numbers.
Michael Grabchak and Lijuan Cao
M. Grabchak (2019). Rejection sampling for tempered Levy processes. Statistics and Computing, 29(3):549-558
M. Grabchak (2021). An exact method for simulating rapidly decreasing tempered stable distributions. Statistics and Probability Letters, 170: Article 109015.
M. Hofert (2011). Sampling exponentially tilted stable distributions. ACM Transactions on Modeling and Computer Simulation, 22(1), 3.
rPRDTS(20, 2, 1, .7, 2) rPRDTS(20, 2, 1, 0, 2) rPRDTS(20, 2, 1, -.7, 2)
rPRDTS(20, 2, 1, .7, 2) rPRDTS(20, 2, 1, 0, 2) rPRDTS(20, 2, 1, -.7, 2)
Simulates from classical tempered stable (CTS) distributions. When alpha=0 this is the gamma distribution.
rSubCTS(n, alpha, c, ell, method = NULL)
rSubCTS(n, alpha, c, ell, method = NULL)
n |
Number of observations. |
alpha |
Parameter in [0,1). |
c |
Parameter >0 |
ell |
Tempering parameter >0 |
method |
Parameter used by retstable in the copula package. When NULL restable selects the best method. |
Simulates a CTS subordinator. The distribution has Laplace transform
L(z) = exp( c int_0^infty (e^(-xz)-1)e^(-x/ell) x^(-1-alpha) dx), z>0
and Levy measure
M(dx) = c e^(-x/ell) x^(-1-alpha) 1(x>0)dx.
Returns a vector of n random numbers.
Uses the method retstable in the copula package.
Michael Grabchak and Lijuan Cao
M. Grabchak (2016). Tempered Stable Distributions: Stochastic Models for Multiscale Processes. Springer, Cham.
rSubCTS(20, .7, 1, 1)
rSubCTS(20, .7, 1, 1)
Simulates from the truncated gamma distribution.
rTrunGamma(n, t, mu, b = 1, step = 1)
rTrunGamma(n, t, mu, b = 1, step = 1)
n |
Number of observations. |
t |
Parameter > 0. |
mu |
Parameter > 0. |
b |
Parameter > 0. |
step |
Tuning parameter. The larger the step, the slower the rejection sampling, but the fewer the number of terms. See Hoefert (2011) or Section 4 in Grabchak (2019). |
Simulates from the truncated gamma distribution. This distribution has Laplace transform
L(z) = exp( t int_0^b (e^(-xz)-1) x^(-1)e^(-mu*x) dx), z>0
and Levy measure
M(dx) = t x^(-1) e^(-mu*x) 1(0<x<b) dx.
The simulation is performed by applying rejection sampling (Algorithm 4.4 in Dassios, Qu, Lim (2020)) to the generalized Dickman distribution. We simulate from the latter using Algorithm 3.1 in Dassios, Qu, Lim (2019).
Returns a vector of n random numbers.
Michael Grabchak and Lijuan Cao
A. Dassios, Y. Qu, J.W. Lim (2019). Exact simulation of generalised Vervaat perpetuities. Journal of Applied Probability, 56(1):57-75.
A. Dassios, Y. Qu, J.W. Lim (2020). Exact simulation of a truncated Levy subordinator. ACM Transactions on Modeling and Computer Simulation, 30(10), 17.
M. Grabchak (2019). Rejection sampling for tempered Levy processes. Statistics and Computing, 29(3):549-558
M. Hofert (2011). Sampling exponentially tilted stable distributions. ACM Transactions on Modeling and Computer Simulation, 22(1), 3.
rTrunGamma(10, 2, 1)
rTrunGamma(10, 2, 1)
Simulates from the truncated stable distribution.
rTrunS(n, t, alpha, b = 1, step = 1)
rTrunS(n, t, alpha, b = 1, step = 1)
n |
Number of observations. |
t |
Parameter > 0. |
alpha |
Parameter in the open interval (0,1). |
b |
Parameter > 0. |
step |
Tuning parameter. The larger the step, the slower the rejection sampling, but the fewer the number of terms. See Hoefert (2011) or Section 4 in Grabchak (2019). |
Simulates from the truncated stable distribution using Algorithm 4.3 in Dassios, Qu, and Lim (2020). This distribution has Laplace transform
L(z) = exp( t * (alpha/Gamma(1-alpha)) * int_0^b (e^(-xz)-1) x^(-1-alpha) dx), z>0
and Levy measure
M(dx) = t * (alpha/Gamma(1-alpha)) * x^(-1-alpha) 1(0<x<b) dx.
Here Gamma() is the gamma function.
Returns a vector of n random numbers.
Michael Grabchak and Lijuan Cao
A. Dassios, Y. Qu, J.W. Lim (2020). Exact simulation of a truncated Levy subordinator. ACM Transactions on Modeling and Computer Simulation, 30(10), 17.
M. Grabchak (2019). Rejection sampling for tempered Levy processes. Statistics and Computing, 29(3):549-558
M. Hofert (2011). Sampling exponentially tilted stable distributions. ACM Transactions on Modeling and Computer Simulation, 22(1), 3.
rTrunS(10, 2, .6)
rTrunS(10, 2, .6)
Simulates from the truncated tempered stable distribution.
rTrunTS(n, t, mu, alpha, b = 1, step = 1)
rTrunTS(n, t, mu, alpha, b = 1, step = 1)
n |
Number of observations. |
t |
Parameter > 0. |
mu |
Parameter > 0. |
alpha |
Parameter in the open interval (0,1). |
b |
Parameter > 0. |
step |
Tuning parameter. The larger the step, the slower the rejection sampling, but the fewer the number of terms. See Hoefert (2011) or Section 4 in Grabchak (2019). |
Simulates from the truncated stable distribution using Algorithm 4.3 in Dassios, Qu, and Lim (2020). This distribution has Laplace transform
L(z) = exp( t * (alpha/Gamma(1-alpha)) * int_0^b (e^(-xz)-1) x^(-1-alpha) e^(-mu*x) dx), z>0
and Levy measure
M(dx) = t * (alpha/Gamma(1-alpha)) * x^(-1-alpha) e^(-mu*x) 1(0<x<b) dx.
Here Gamma() is the gamma function.
Returns a vector of n random numbers.
Michael Grabchak and Lijuan Cao
A. Dassios, Y. Qu, J.W. Lim (2020). Exact simulation of a truncated Levy subordinator. ACM Transactions on Modeling and Computer Simulation, 30(10), 17.
M. Grabchak (2019). Rejection sampling for tempered Levy processes. Statistics and Computing, 29(3):549-558
M. Hofert (2011). Sampling exponentially tilted stable distributions. ACM Transactions on Modeling and Computer Simulation, 22(1), 3.
rTrunTS(10, 2, 2, .6)
rTrunTS(10, 2, 2, .6)
Implements Algorithm 4.2 in Dassios, Qu, and Lim (2020) to simulate from a stable distribution conditioned on an appropriate event.
simCondS(t, alpha)
simCondS(t, alpha)
t |
Parameter > 0. |
alpha |
Parameter in the open interval (0,1). |
Implements Algorithm 4.2 in Dassios, Qu, and Lim (2020) to simulate from a stable distribution conditioned on an appropriate event. There are some typos in this algorithm, which are corrected in Grabchak (2021). These random variables are needed to simulate truncated stable, truncated tempered stable, and p-RDTS random variables.
Returns one random number.
Michael Grabchak and Lijuan Cao
A. Dassios, Y. Qu, J.W. Lim (2020). Exact simulation of a truncated Levy subordinator. ACM Transactions on Modeling and Computer Simulation, 30(10), 17.
M. Grabchak (2021). An exact method for simulating rapidly decreasing tempered stable distributions. Statistics and Probability Letters, 170: Article 109015.
simCondS(2, .7)
simCondS(2, .7)
Simulates the hitting time T and the overshoot W of a stable process by implimenting Algorithm 4.1 in Dassios, Qu, and Lim (2020). This is important for simulating other distribution.
simTandW(alpha)
simTandW(alpha)
alpha |
Parameter in the open interval (0,1). |
Returns one pair of random numbers. The first is T and the second is W.
Michael Grabchak and Lijuan Cao
A. Dassios, Y. Qu, J.W. Lim (2020). Exact simulation of a truncated Levy subordinator. ACM Transactions on Modeling and Computer Simulation, 30(10), 17.
simTandW(.6)
simTandW(.6)