walk-z
approximation of a random walk where any point in time can be reached without recursion
• Introduction • API • License •
Introduction
Made for when a full time-serie is required for a given simulation. Past values are retained to provide new random values that are consistent with previously returned pasts and futures.
This is not a true random walk but a simulation for simulations. You probably don't need this. Use with caution.
Like a random walk:
E( y(t) ) = 0
V( y(t) ) = t
Cov( y(t), y(t+1) ) = 1
Shift and scale the results as required
API
The factory function usually takes no parameters and returns a random time serie.
var WalkZ = var walker = var positionAtTime100 = var positionAtTime200 = var positionAtTime2 =
For testing or for generating correlated curves, an option normal unit distribution seed ( -inf < x < +inf) can be provided:
var WalkZ = var walker = //randomZ is a function that takes no parameter and returns a unit normal distributionvar positionAtTime3 =
License
Released under the MIT License