Re: [R] Simulation using parts of density function

2007-05-02 Thread Ted Harding
On 02-May-07 07:45:48, Prof Brian Ripley wrote: > Please do not send everything twice: you are using R-help in both the > To: > and Cc: fields. > > I disagree with Ted: it _is_ much easier to create a generator for this > purpose. > > Consider > > rtgamma <- function(n, ..., tr = log(500))

Re: [R] Simulation using parts of density function

2007-05-02 Thread Prof Brian Ripley
[EMAIL PROTECTED] Gesendet: Dienstag, 1. Mai 2007 20:18 An: Thür Brigitte Cc: r-help@stat.math.ethz.ch Betreff: RE: [R] Simulation using parts of density function On 01-May-07 17:03:46, Thür Brigitte wrote: Hi My simulation with the followin R code works perfectly: sim <- replicate(999, sum(exp(

Re: [R] Simulation using parts of density function

2007-05-02 Thread Thür Brigitte
remain<-(x - length(sim)) } sim<-sim[1:x]} sim.test <- rbind(sim.test, c(value=sum(sim))) Thanks for any help, Brigitte -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 1. Mai 2007 20:18 An: Thür Brigitte Cc: r-help@st

Re: [R] Simulation using parts of density function

2007-05-01 Thread Ted Harding
On 01-May-07 17:03:46, Thür Brigitte wrote: > > Hi > > My simulation with the followin R code works perfectly: > sim <- replicate(999, sum(exp(rgamma(rpois(1,2000), > scale = 0.5, shape = 12 > > But now I do not want to have values in object "sim" exceeding > 5'000'000, that means that I am

[R] Simulation using parts of density function

2007-05-01 Thread Thür Brigitte
Hi My simulation with the followin R code works perfectly: sim <- replicate(999, sum(exp(rgamma(rpois(1,2000), scale = 0.5, shape = 12 But now I do not want to have values in object "sim" exceeding 5'000'000, that means that I am just using the beginning of densitiy function gamma x < 15.4.