Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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.

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.

Value

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

Author(s)

Esam Mahdi and A.I. McLeod.

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

## 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)

portes

Portmanteau Tests for Univariate and Multivariate Time Series Models

v5.0
GPL (>= 2)
Authors
Esam Mahdi [aut, cre], Ian McLeod [ctb]
Initial release
2020-12-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.