Hi,

On Tue, May 11, 2010 at 12:36 PM,  <khaz...@ceremade.dauphine.fr> wrote:
> Hi,
> At each iteration in my program,I need to generate  tree vectors,X1,X2,X3,
> from exponential distribution with parameters a1,a2,a3. Can you help me
> please how can I do it such that it take a little time?

So, at each iteration you're sampling from three different exponential
distributions, each with rate parameters a1, a2, a3 respectively?

Say you have 100 iterations, you can create vectors of length 100
having samples from each distro like so:

R> dist1 <- rexp(100, rate=a1)
R> dist2 <- rexp(100, rate=a2)
R> dist3 <- rexp(100, rate=a3)

... and use them as you would expect where you need them.

-steve

-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to