View source: R/distributionFuns.R
generate_skewed_t | R Documentation |
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)
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 |
bc_M |
An optional numeric scalar specifying the bounding constant |
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.
A numeric vector of length n
containing random observations from the skewed t-distribution with
parameters nu
and lambda
.
Hansen B.E. 1994. Autoregressive Conditional Density estimation. Journal of Econometrics, 35:3, 705-730.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.