0

I have the code as detailed below. The basic description of what I require is to repeat this code 30 times and have the end values assigned as a vector if possible. I also need the seed to be increased by one each time the simulation is run. So I was thinking about using replicate or maybe repeat. But as replicate needs rep(vector, times), I'm not so sure as I don't have a specific vector to be assigned.

To explain the code a little better, A is a first best guess of values which in turn informs B. B is then used as input to C which informs D. C and D then iterate until convergence for three values.

rep(vector,40){
set.seed(100)

...............
A
..............
B
..............

for (n in 1:50){
...............
C
..............
D
..............
}
}
4

1 に答える 1