[R] problem in generating positive stable random numbers

Peter Dalgaard p.dalgaard at biostat.ku.dk
Tue Aug 30 21:55:50 CEST 2005


"X. Cong" <xcong at stat.rice.edu> writes:

> Dear all,
> 
> I am trying to use the
> rstable(n, alpha, beta, gamma = 1, delta = 0, pm = c(0, 1, 2)))
> 
>  function to generate positive stable random numbers. For positive stable
> distribution, beta==1 and alpha is in (0,1), which defines random variables
> with support (0, infinity). So, I used rstable(100, 0.5, 1) for an example.
> I found that this gives me some negative numbers. For example,
> 
> > rstable(10, 0.5, 1)
>  [1]   6.3016252 399.3659030  11.2735789   1.9550625  -0.6762333   1.6810761
>  [7]   0.9091360   1.9100991  -0.7593737  24.2788471
> 
> Does anybody know why this should happen?

Doesn't sound like it should... 

>From where did you get rstable()? It isn't part of R itself, and
poking around shows at least three different sources for it
(CircStats, fBasics, stable (Lambert/Lindsey, not on CRAN)). I seem to
recall that the third one also has a distribution function which is
almost, but not quite monotone.

The usual advice of taking package problems to the package maintainer
applies. 

-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907




More information about the R-help mailing list