Message-ID: <x2y86jb3nd.fsf@turmalin.kubism.ku.dk>
Date: 2005-08-30T19:55:50Z
From: Peter Dalgaard
Subject: problem in generating positive stable random numbers
In-Reply-To: <006e01c5c5f4$dc9b1410$59142a80@stat.rice.edu>
"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