Learn R Programming

portes (version 5.0)

rStable: Generate Data From Stable Distributions

Description

Generate data from stable distribution with infinite variance.

Usage

rStable(n, Alpha, Beta, Scale = NULL, Location = NULL)

Arguments

n

length of the series.

Alpha

index stability parameters, each in the range (0,2].

Beta

skewness parameters, each in the range [-1, 1].

Scale

scale parameters.

Location

location parameters.

Value

A vector of dimension \(n\times k\) from independent stable distributions.

Details

Alpha, Beta, Scale, and Location 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 (2014). "fBasics: Rmetrics - Markets and Basic Statistics". R package version 3011.87. https://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
# NOT RUN {
## Generate Univariate Data
n <- 500
Alpha <- 1.75
Beta <- 0
Scale <- 1.5
Location <- 0
rStable(n, Alpha, Beta, Scale, Location)                
## 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)
Scale <- c(3,1,6)
rStable(n, Alpha, Beta,Scale)  
# }

Run the code above in your browser using DataLab