Learn R Programming

yuima (version 1.0.81)

rng: Random numbers and densities

Description

simulate function can use the specific random number generators to generate Levy paths.

Usage

rIG(x,delta,gamma)
dIG(x,delta,gamma)
rNIG(x,alpha,beta,delta,mu,Lambda)
dNIG(x,alpha,beta,delta,mu,Lambda)
rbgamma(x,delta.plus,gamma.plus,delta.minus,gamma.minus)
dbgamma(x,delta.plus,gamma.plus,delta.minus,gamma.minus)
rngamma(x,lambda,alpha,beta,mu,Lambda)
dngamma(x,lambda,alpha,beta,mu,Lambda)
rstable(x,alpha,beta,sigma,gamma)

Arguments

x
Number of R.Ns to be geneated.
delta
parameter
gamma
parameter
mu
parameter
Lambda
parameter
alpha
parameter
lambda
parameter
sigma
parameter
beta
parameter
delta.plus
parameter
gamma.plus
parameter
delta.minus
parameter
gamma.minus
parameter

Value

  • rXXXCollection of of random numbers or vectors
  • dXXXDensity dunction

Details

IG (inverse Gaussian): Delta and gamma are positive (the case of gamma=0 corresponds to the positive half stable, provided by the "rstable").

NIG (normal inverse Gaussian): It is defined by the normal mean-variance mixuture of inverse Gaussian distribution. The parameters alpha, beta, delta and mu express the heaviness of tails, degree of asymmetry, scale and location, respectively. They satisfy the following conditions: Lambda is positive definite with det(Lambda)=1; delta>0; alpha>0 with alpha^2-beta^T Lambda beta >0.

bgamma (bilateral gamma): Bilateral gamma distribution is defined by the difference of independent gamma distributions Gamma(delta.plus,gamma.plus) and Gamma(delta.minus,gamma.minus).

ngamma (normal gamma): Normal gamma distribution is defined by the normal mean-variance mixture of gamma distribution. The parameters satisfy the following conditions: Lambda is positive definite with det(Lambda)=1; lambda>0; alpha>0 with alpha^2-beta^T Lambda beta >0. Especially in the case of beta=0 it is variance gamma distribution.

stable (stable): Parameters alpha, beta, sigma and gamma express stability, degree of skewness, scale and location, respectively. They satisfy the following condition: 00; gamma is a real number.

Examples

Run this code
set.seed(123)

# Ex 1. (One-dimensional standard Cauchy distribution)
# The value of parameters is alpha=1,beta=0,sigma=1,gamma=0.
# Choose the value of x.
x<-10 # the number of r.n
rstable(x,1,0,1,0)

# Ex 2. (One-dimensional Levy distribution)
# Choose the value of sigma, gamma, x.
# alpha = 0.5, beta=1
x<-10 # the number of r.n
beta <- 1
sigma <- 0.1
gamma <- 0.1
rstable(x,0.5,beta,sigma,gamma)

# Ex 3. (Symmetric bilateral gamma)
# delta=delta.plus=delta.minus, gamma=gamma.plus=gamma.minus.
# Choose the value of delta and gamma and x.
x<-10 # the number of r.n
rbgamma(x,1,1,1,1)

# Ex 4. (One-dimensional normal inverse Gaussian distribution)
# Lambda=1.
# Choose the value of parameters and x.
x<-10 # the number of r.n
rNIG(x,1,1,1,1)

# Ex 5. (Multi-dimensional normal inverse Gaussian distribution)
# Choose the value of parameters and x.
beta<-c(.5,.5)
mu<-c(0,0)
Lambda<-matrix(c(1,0,0,1),2,2)
x<-10 # the number of r.n
rNIG(x,1,beta,1,mu,Lambda)

Run the code above in your browser using DataLab