On 23/07/2008, at 9:50 AM, Peter Dalgaard wrote:
Rolf Turner wrote:
matrix(unlist(lapply(1:1000,function(x){arima.sim(list(ar=0.3),
100)+mean})),nrow=1000,byrow=TRUE)
Whatever did replicate() ever do to you to deserve getting so
rudely ignored?
replicate(1000, arima.sim(list(ar=.3),100)) + mean
(OK, so t(...) then)
Another of the many lacunae in my knowledge ... I'd either never
learned
about, or had forgotten, replicate().
BTW --- to retain the time series nature of the results, you can do:
replicate(1000, arima.sim(list(ar=.3),100) + mean, simplify=FALSE)
cheers,
Rolf
P. S. Just occurred to me --- ``mean'' is a Bad Name for a mean
vector, since
there is a function called ``mean''. No disasters imminent, but it's
a bad
policy.
R.
######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}
______________________________________________
[email protected] 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.