Suggested solution
If I understood the question right, then the simplest solution here would probably be to define a helper function like the following:
vv[n_] := Internal`InheritedBlock[{v}, v /@ Range[n]];
Then, you get
vel = vv[m]
and every run of vv would result in different set of values, while the values in the set will all come from the same memoization "run".
The presence of Internal`InheritedBlock guarantees that whatever values were remembered inside of it, will be cleared automatically when the execution leaves the block.
Example
For example:
ClearAll[f, v, s, vv];
s = 1;
f[x_] := x;
v[0] := 0;
v[n_] := v[n] = v[n - 1] + f[n - 1] + Random[NormalDistribution[0, s]];
vv[n_] := Internal`InheritedBlock[{v}, v /@ Range[n]];
Test:
vv[10]
(* {-0.0712327, 1.67558, 4.93819, 9.21973, 13.7199, 17.3607, 22.7843, 31.0941, 37.9027, 47.6244} *)
vv[10]
(* {-3.29625, -2.51668, -0.464889, 1.71271, 4.70297, 9.78192, 15.8081, 22.5965, 29.3856, 38.323} *)
Links
Closely related questions:
3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! – Nov 09 '15 at 18:26
DownValues. – Pillsy Nov 09 '15 at 18:31Scan[Composition[Unset, v], {2, 3, 7, 8}]. You can useRange[n]as the list of values to clear, thus leavingv[0]and the general rule. – J. M.'s missing motivation Nov 09 '15 at 18:34RandomVariates are generated. – Pillsy Nov 09 '15 at 18:35Accumulate[RandomVariate[NormalDistribution[0, s], n]]. – J. M.'s missing motivation Nov 09 '15 at 18:43f[]. However, something equally terse should work. – Eric Towers Nov 10 '15 at 04:15Accumulate[]'s should do the trick in that case; I just wanted to give the OP an alternate view. – J. M.'s missing motivation Nov 10 '15 at 04:20