3.0.1 • Published 5 years ago

walk-z v3.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

walk-z

approximation of a random walk where any point in time can be reached without recursion

IntroductionAPILicense

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 = require('walk-z')
var walker = WalkZ()
var positionAtTime100 = walker(100)
var positionAtTime200 = walker(200)
var positionAtTime2 = walker(2)

For testing or for generating correlated curves, an option normal unit distribution seed ( -inf < x < +inf) can be provided:

var WalkZ = require('walk-z')
var walker = WalkZ()
//randomZ is a function that takes no parameter and returns a unit normal distribution
var positionAtTime3 = walker(3, randomZ())

License

Released under the MIT License

3.0.1

5 years ago

3.0.0

5 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.0.0

8 years ago