I am interested in creating multiple (say 1000) time series, from a
given stochastic process, of length 250. I want to refer to each
realization with its own variable name, of the format say, tsn, where
n is the n'th simulation. i.e. ts1, ts2, ts3, ts4, .... , ts1000

The way I am thinking of doing this is placing the following code
within another loop, and the 'tsn' assignment should happen as ts1 and
so on, the n being taken from the iteration of the outer loop.
However, crucially, I don't know how/whether I can create variable
names dynamically and assign values to them.

#begin

tsn <- (10);

for (i in 1:250) {

  tsn <- c(tsn, tsn[i] + rnorm(1, mean=0.01, sd=0.025))

                     };

plot.ts(tsn, lwd=2, col="maroon");

#end


Thanks in anticipation.


Best Regards

Vishal Belsare

______________________________________________
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