I don't think this one got any answers. rannegbin(r, c, n, p) draws an r X c matrix from NegBin(n,p), with n>=1 an integer: the sum of n independent geometric random numbers. Here it is 0.1, which corresponds to n=0. The mean of weibull(a,b) is a^(-1/b)*gammafact(1 + 1/b), which is 0.8099 here. Also see the Ox book. Jurgen. oxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxox oxoxoxox 3rd OxMetrics user conference August 2005 oxoxoxox Cass Business School, London oxoxoxox 17 August (afternoon) - 18 August (morning) oxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxox Dr Jurgen A Doornik Nuffield College, Oxford OX1 1NF, UK tel. UK: +44-1865-278610 fax +44-1865-278621 http://www.doornik.com http://www.oxmetrics.net oxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxox Vumani Dlamini wrote: > Dear ox users, > I am trying to sample from a negative binomial (using "rannegbin") and from > a Weibull distribution but am getting running into problems. I use the code > below; > > #include <oxstd.h>; > #include <oxprob.h>; > > main() > { > decl x; > x=rannegbin(10,1,0.1,0.1/3.1);// size = 0.1 and mu=3 > print(x); > x=ranweibull(10,1,5,10);//a is scale and b is shape parameter > (mean=9.18) > print(x) > } > > For the negative binomial the number of failures is zero for all ten > observations, and for the Weibull the times are all less that 1 (whilst the > expectation is 9.18). > > I noticed in passing that for the negative binomial is "size" is less > than 1 > all the number of failures will be zero, which is not necessarily correct. > Possibly, I am confused by the parametrization used in OX. > > Can you enlighten me? > > Vumani > > _________________________________________________________________ > Play online games with your friends with MSN Messenger > http://messenger.msn.nl/ >