Generate random samples from the skewed t-distribution
Generate random samples from the skewed t-distribution
generate_skewed_t generates n random observations from the univariate skewed t-distribution described in Hansen (1994) using the acceptance-rejection sampling method.
generate_skewed_t(n, nu, lambda, bc_M)
Arguments
n: An integer specifying the number of random observations to generate. Must be a positive integer.
nu: A numeric scalar specifying the degrees of freedom parameter for the skewed t-distribution. Must be greater than 2.
lambda: A numeric scalar specifying the skewness parameter for the skewed t-distribution. Must be between −1 and 1.
bc_M: An optional numeric scalar specifying the bounding constant M used in the acceptance-rejection algorithm. If not provided, it is computed using bounding_const_M with the given nu and lambda.
Returns
A numeric vector of length n containing random observations from the skewed t-distribution with parameters nu and lambda.
Details
The function implements the acceptance-rejection algorithm to generate random samples from the skewed t-distribution. The proposal distribution used is a standard t-distribution with degrees of freedom proposal_nu, which is set to 3
when nu > 3 to ensure heavier tails and accommodate the skewness of the target distribution.
If bounding_const_M is not provided, it is calculated using the bounding_const_M function. It is important that the same proposal distribution is used in both the computation of bounding_const_M and the acceptance-rejection sampling algorithm to ensure correctness.
References
Hansen B.E. 1994. Autoregressive Conditional Density estimation. Journal of Econometrics, 35 :3, 705-730.