Questions tagged [stochastic-process]

A stochastic process is a collection of related random variables, often used as a model for a quantity that varies over time or space with some degree of smoothness.

In probability theory, a stochastic process, or sometimes random process (widely used) is a collection of random variables; this is often used to represent the evolution of some random value, or system, over time. This is the probabilistic counterpart to a deterministic process (or deterministic system). Instead of describing a process which can only evolve in one way (as in the case, for example, of solutions of an ordinary differential equation), in a stochastic or random process there is some indeterminacy: even if the initial condition (or starting point) is known, there are several (often infinitely many) directions in which the process may evolve.

In the simple case of discrete time, a stochastic process amounts to a sequence of random variables known as a time series (for example, see Markov chain). Another basic type of a stochastic process is a random field, whose domain is a region of space, in other words, a random function whose arguments are drawn from a range of continuously changing values. One approach to stochastic processes treats them as functions of one or several deterministic arguments (inputs, in most cases regarded as time) whose values (outputs) are random variables: non-deterministic (single) quantities which have certain probability distributions. Random variables corresponding to various times (or points, in the case of random fields) may be completely different. The main requirement is that these different random quantities all have the same type. Type refers to the co-domain of the function. Although the random values of a stochastic process at different times may be independent random variables, in most commonly considered situations they exhibit complicated statistical correlations.

Familiar examples of processes modeled as stochastic time series include stock market and exchange rate fluctuations, signals such as speech, audio and video, medical data such as a patient's EKG, EEG, blood pressure or temperature, and random movement such as Brownian motion or random walks. Examples of random fields include static images, random terrain (landscapes), wind waves or composition variations of a heterogeneous material.

130 questions
22
votes
11 answers

Are there known techniques to generate realistic looking fake stock data?

I recently wrote some Javascript code to generate random fake stock data as I wanted to show a chart that at first glanced looked like real stock data - but all I came up with was pretty noddy. I was just wondering if there are some resources that…
Mark Rhodes
  • 9,375
  • 4
  • 44
  • 51
15
votes
5 answers

Stochastic calculus library in python

I am looking for a python library that would allow me to compute stochastic calculus stuff, like the (conditional) expectation of a random process I would define the diffusion. I had a look a at simpy (simpy.sourceforge.net), but it does not seem to…
LeMiz
  • 5,068
  • 5
  • 25
  • 23
13
votes
4 answers

Unit testing for stochastic processes?

Is there a sane way to unit test a stochastic process? For example say that you have coded a simulator for a specific system model. The simulator works randomly based on the seeds of the rngs so the state of the system cannot be predicted and if it…
imoschak
  • 215
  • 2
  • 8
11
votes
8 answers

How do I generate a Poisson Process?

Original Question: I want to generate a Poisson process. If the number of arrivals by time t is N(t) and I have a Poisson distribution with parameter λ how do I generate N(t)? How would I do this in C++? Clarification: I originally wanted to…
bias
  • 1,522
  • 3
  • 19
  • 34
8
votes
1 answer

Dynamic (i.e. variable size) Fenwick Tree?

Questions: I have stumbled upon Fenwick trees (Binary index trees) that allow to calculate cumulative sums easily. However, I have only found implementations where the number of leeves (summands) is constant (but their value can change). Is there…
matthse
  • 83
  • 3
7
votes
1 answer

How to compute residuals of a point process in python

I am trying to reproduce the work from http://jheusser.github.io/2013/09/08/hawkes.html in python except with different data. I have written code to simulate a Poisson process as well as the Hawkes process they describe. To do the Hawkes model MLE…
eleanora
  • 9,397
  • 17
  • 58
  • 128
7
votes
0 answers

Fitting a non-homogeneous poisson-process with PyMC

I'm new to PyMC and trying to fit my non-homogeneous poisson-process with a piecewise-constant rate function using the maximum a posteriori estimate. My process describes some events during a day. Therefore i'm splitting a day into 24 hours, which…
sascha
  • 27,544
  • 6
  • 57
  • 97
6
votes
2 answers

What is going on with floating point precision here?

This question is in reference is an observation from a code-golf challenge. The submitted R solution is a working solution, but a few of us (maybe just I) seems to be dumbfounded as to why the initial X=m reassignment is necessary. The code is…
6
votes
4 answers

Algorithm to find hole in an infinite one dimensional graph

A cow is standing in front of an infinite fence . On the other side is grass. The cow wants to get to this grass. Somewhere along this fence is a hole through which the cow can get to the other side. The distance d from the cow to the hole has a…
Nitin Garg
  • 2,019
  • 5
  • 25
  • 50
6
votes
2 answers

How can we produce kappa and delta in the following model using Matlab?

I have a following stochastic model describing evolution of a process (Y) in space and time. Ds and Dt are domain in space (2D with x and y axes) and time (1D with t axis). This model is usually known as mixed-effects model or…
user238469
5
votes
2 answers

Tutorial on stochastic simulation in Haskell

I'd like to use Haskell for stochastic simulation, but I don't know how. I've read Hutton's 'Programming in Haskell', and I'm comfortable writing deterministic functional programs. However, I don't know how to start writing stochastic simulations of…
Marius Kempe
  • 413
  • 3
  • 9
4
votes
2 answers

Predicting a Poisson process

I want to predict the inter-arrival times of road traffic with Poisson distribution. At the moment, I produce the (synthetic) arrival times with Poisson process so that the inter-arrival times have exponential distribution. Observing the past data,…
4
votes
1 answer

How to solve / fit a geometric brownian motion process in Python?

For example, the below code simulates Geometric Brownian Motion (GBM) process, which satisfies the following stochastic differential equation: The code is a condensed version of the code in this Wikipedia article. import numpy as…
Greg
  • 6,043
  • 8
  • 41
  • 93
4
votes
0 answers

How to evaluate Markov Model accuracy

I have created the following Markov chain Model. And I am struggling to prove mathematically that my model works correctly, or doesn't work. Sequence: Start, state1, state2, state3, state3, state2, state1, state2, state1, end States: start, state1,…
4
votes
0 answers

How could time series prediction be applied in a real-time setting where it is infeasible to track every single item?

The problem: Find the estimated lifetime of an object (e.g. the time it is written next) or the corresponding PDF. This is known as a renewal process. Constraint: it is infeasible to track metadata for every single object Assumptions: Prediction…
1
2 3
8 9