Learn R Programming

portes (version 1.08)

rstable: Generate Data From Stable Distributions

Description

Generate data from stable distribution with infinite variance.

Usage

rstable(n, ALPHA, BETA, GAMMA = NULL, DELTA = NULL)

Arguments

n
length of the series.
ALPHA
index parameters, each in the range (0,2].
BETA
skewness parameters, each in the range [-1, 1].
GAMMA
scale parameters.
DELTA
location parameters.

Value

  • A vector of dimension $n\times k$ from independent stable distributions.

Details

ALPHA, BETA, GAMMA, and DELTA should have the same length. This length, $k$, represents the number of the variables that we need to generate. The code in the function rstable extends that one given in the package fBasics to the multivariate case. Many thanks to Diethelm Wuertz for putting his code under the GPL license.

References

Chambers, J.M., Mallows, C.L., and Stuck, B.W. (1976). "A Method for Simulating Stable Random Variables". Journal of American Statistical Association, 71, 340-344. Wuertz, D., core team members R (2010). "fBasics: Rmetrics - Markets and Basic Statistics". http://CRAN.R-project.org/package=fBasics

See Also

There is also a function rstable in the fBasics package for the univariate case only. See also fitstable, varima.sim

Examples

Run this code
## Generate Univariate Data
n <- 500
ALPHA <- 1.75
BETA <- 0
GAMMA <- 1.5
DELTA <- 0
rstable(n, ALPHA, BETA, GAMMA, DELTA)                
## Generate Bivariate Data  
n <- 500
ALPHA <- c(1.3,1.5)
BETA <- c(0.3,-0.6)
rstable(n, ALPHA, BETA)  
## Generate Multivariate Data
n <- 500
ALPHA <- c(1.3,1.5,1.7)
BETA <- c(0.3,-0.6,0)
GAMMA <- c(3,1,6)
rstable(n, ALPHA, BETA,GAMMA)

Run the code above in your browser using DataLab