RNSTA
Generates pseudorandom numbers from a stable distribution.
Required Arguments
ALPHA — Characteristic exponent of the stable distribution. (Input)
This parameter must be positive and less than or equal to 2.
BPRIME — Skewness parameter of the stable distribution. (Input)
When BPRIME = 0, the distribution is symmetric. Unless ALPHA = 1, BPRIME is not the usual skewness parameter of the stable distribution. BPRIME must be greater than or equal to – 1 and less than or equal to 1.
R — Vector of length NR containing the random stable deviates. (Output)
Optional Arguments
NR — Number of random numbers to generate. (Input)
Default: NR = size (R,1).
FORTRAN 90 Interface
Generic: CALL RNSTA (ALPHA, BPRIME, R [])
Specific: The specific interface names are S_RNSTA and D_RNSTA.
FORTRAN 77 Interface
Single: CALL RNSTA (NR, ALPHA, BPRIME, R)
Double: The double precision name is DRNSTA.
Description
Routine RNSTA generates pseudorandom numbers from a stable distribution with parameters ALPHA and BPRIME. ALPHA is the usual characteristic exponent parameter α and BPRIME is related to the usual skewness parameter β of the stable distribution. With the restrictions 0 < α  2 and  β  1, the characteristic function of the distribution is
ϕ(t) = exp[–|t|α exp(–πiβ(1  |1  α|) sign(t)/2)] for α  1
and
ϕ(t) = exp[–|t|(1 + 2iβln|t|sign(t)/π)] for α = 1
When β = 0, the distribution is symmetric. In this case, if α = 2, the distribution is normal with mean 0 and variance 2; and if α = 1, the distribution is Cauchy.
The parameterization using BPRIME and the algorithm used here are due to Chambers, Mallows, and Stuck (1976). The relationship between BPRIME = βʹ and the standard β is
βʹ = tan(π(1  α)/2) tan(πβ(1  |1  α|)/2) for α  1
and
βʹ = β for α = 1
The algorithm involves formation of the ratio of a uniform and an exponential random variate.
Comments
The routine RNSET can be used to initialize the seed of the random number generator. The routine RNOPT can be used to select the form of the generator.
Example
In this example, RNSTA is used to generate five pseudorandom symmetric stable variates with characteristic exponent 1.5. The tails of this distribution are heavier than those of a normal distribution, but not so heavy as those of a Cauchy distribution. The variance of this distribution does not exist, however. (This is the case for any stable distribution with characteristic exponent less than 2.)
 
USE RNSTA_INT
USE UMACH_INT
USE RNSET_INT
 
IMPLICIT NONE
INTEGER NR
PARAMETER (NR=5)
!
INTEGER ISEED, NOUT
REAL ALPHA, BPRIM, R(NR)
!
CALL UMACH (2, NOUT)
ALPHA = 1.5
BPRIM = 0.0
ISEED = 123457
CALL RNSET (ISEED)
CALL RNSTA (ALPHA, BPRIM, R)
WRITE (NOUT,99999) R
99999 FORMAT (' Stable random deviates: ', 5F9.4)
END
Output
 
Stable random deviates: 4.4091 1.0564 2.5463 5.6724 2.1656