On Fri, Jan 27, 2012 at 6:35 AM, Christopher Kelvin
<chris_kelvin2...@yahoo.com> wrote:
> Hello,
> How can i do simulation with a weibull distribution after i have generated 
> data with the distribution,
> for example; if i generate x=rweibull(50,shape=0.8,scale=2) and i want to 
> simulate this data 1000 times so that i can use it to estimate
> the parameters.

library(MASS)
set.seed(123)
n <- 1000
k <- 50
r <- matrix(rweibull(n*k, shape = 0.8, scale =2), k)
m <- t(apply(r, 2, function(x) coef(fitdistr(x, "weibull"))))
summary(m)

Please use a meaningful subject on your posts to r-help and trim them
so that they don't include the literally thousands of lines of garbage
that were at the end of your post.

______________________________________________
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