randomWalkWithDrift method
Generates a random walk with drift.
Implementation
List<double> randomWalkWithDrift(
int steps, {
double start = 0,
double drift = 0,
double volatility = 1,
}) {
final values = <double>[start];
for (int i = 1; i < steps; i++) {
final step = drift + normal(0, volatility);
values.add(values.last + step);
}
return values;
}